fix(ci): build packages from repo root to avoid stdlib shadowing

The hanzoai package has a types/ directory that shadows Python's
stdlib types module when building from within pkg/hanzoai/. Build
from the repo root using `python -m build pkg/$package` instead.
This commit is contained in:
Zoo Queen
2026-02-21 11:54:54 -08:00
parent f3d9926d01
commit 8dbd1d6414
+5 -9
View File
@@ -157,20 +157,16 @@ jobs:
echo "=========================================="
echo "Building and publishing $package..."
echo "=========================================="
if [ -d "pkg/$package" ]; then
cd "pkg/$package"
# Clean any previous builds
rm -rf dist/ build/ *.egg-info
rm -rf "pkg/$package/dist/" "pkg/$package/build/"
# Build the package
python -m build
# Build from repo root to avoid stdlib shadowing (hanzoai/types vs types)
python -m build "pkg/$package" --outdir "pkg/$package/dist"
# Upload to PyPI
python -m twine upload dist/* --skip-existing || echo "Warning: Failed to upload $package (may already exist)"
cd ../..
python -m twine upload "pkg/$package/dist/"* --skip-existing || echo "Warning: Failed to upload $package (may already exist)"
else
echo "Warning: Package directory pkg/$package does not exist, skipping"
fi