-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.sh
More file actions
30 lines (23 loc) · 771 Bytes
/
build.sh
File metadata and controls
30 lines (23 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# build.sh — clean + test + build your Python package
set -euo pipefail
# 1. Clean up old builds
echo "🧹 Cleaning up previous builds…"
rm -rf build/ dist/ *.egg-info/
# 2. Run your test suite (if you have one)
if command -v pytest &> /dev/null; then
echo "🧪 Running tests…"
pytest
else
echo "⚠️ pytest not found — skipping tests"
fi
# 3. Ensure build tools are installed
echo "📦 Ensuring latest build tools…"
python3 -m pip install --upgrade build wheel twine
# 4. Build source & wheel
echo "🚧 Building source and wheel distributions…"
python3 -m build
# 5. Verify the distributions
echo "🔍 Checking distribution integrity…"
python3 -m twine check dist/*
echo "✅ Build complete — artifacts in dist/"