diff --git a/.github/workflows/pip-release.yml b/.github/workflows/pip-release.yml index 7695f949..4fb6f65b 100644 --- a/.github/workflows/pip-release.yml +++ b/.github/workflows/pip-release.yml @@ -147,24 +147,53 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install build backend - run: pip install build>=1.2 + run: python -m pip install --upgrade pip build>=1.2 - name: Build sdist + wheel working-directory: python/tombstone run: python -m build --outdir ../../tombstone-dist - # Smoke-test: the wheel MUST raise ImportError on import. - - name: Smoke-test tombstone + # Inspect what was actually built — the previous v1.99.0-pip run + # showed an `import wifi_densepose` that returned cleanly instead + # of raising, even though build logs said `adding 'wifi_densepose/__init__.py'`. + # Print the wheel manifest + the __init__.py content so any + # future regression is debuggable from the run log alone. + - name: Inspect wheel contents run: | - python -m pip install tombstone-dist/wifi_densepose-1.99.0-py3-none-any.whl + set -e + WHL=tombstone-dist/wifi_densepose-1.99.0-py3-none-any.whl + echo "--- wheel listing ---" + python -m zipfile -l "$WHL" + echo "--- wifi_densepose/__init__.py inside the wheel ---" + python -m zipfile -e "$WHL" /tmp/tomb-inspect + cat /tmp/tomb-inspect/wifi_densepose/__init__.py + echo "--- size in bytes ---" + wc -c /tmp/tomb-inspect/wifi_densepose/__init__.py + # Smoke-test in an ISOLATED venv. The previous run's failure + # mode was that the ubuntu-latest runner's system `python` had + # site-packages picking up something other than the user-installed + # wheel, so the import resolved to a different module. A clean + # venv removes any ambiguity about which wifi_densepose is loaded. + - name: Smoke-test tombstone in isolated venv + run: | + set -e + python -m venv /tmp/smoke-venv + /tmp/smoke-venv/bin/python -m pip install --upgrade pip + /tmp/smoke-venv/bin/python -m pip install tombstone-dist/wifi_densepose-1.99.0-py3-none-any.whl + # Show where wifi_densepose actually resolved + that the file + # the venv would import is the tombstone, NOT something else + # on the path. + /tmp/smoke-venv/bin/python -c "import importlib.util as u; s = u.find_spec('wifi_densepose'); print('Resolved to:', s.origin); print('--- file content ---'); print(open(s.origin).read())" set +e - python -c "import wifi_densepose" 2> import-output.txt + /tmp/smoke-venv/bin/python -c "import wifi_densepose" 2> import-output.txt rc=$? set -e if [ "$rc" -eq 0 ]; then echo "ERROR: tombstone import succeeded — should have raised ImportError" exit 1 fi - # Must include the migration URL so users can find their way home. if ! grep -q "github.com/ruvnet/RuView" import-output.txt; then echo "ERROR: tombstone ImportError missing migration URL" cat import-output.txt