diff --git a/bindings/python/release.sh b/bindings/python/release.sh index a67e09c..f96cfe1 100755 --- a/bindings/python/release.sh +++ b/bindings/python/release.sh @@ -21,5 +21,12 @@ trap cleanup EXIT rm -rf build dist *.egg-info python3 setup.py sdist +if ! tar tzf dist/*.tar.gz | grep -q 'genomicsqlite/sqlite_web_dbi\.py$'; then + >&2 echo "The sdist is missing genomicsqlite/sqlite_web_dbi.py; refusing to release." + >&2 echo "That module is a symlink into build/_deps/sqlite_web_vfs-src/, populated by the CMake build." + >&2 echo "This tree was never built, so setuptools dropped the dangling symlink silently." + >&2 echo "Build this tree (or materialize the file from a built tree), rebuild the sdist, and retry." + exit 1 +fi echo -e "\033[0;31;5m -- Pushing $(basename `ls -1 dist/*.tar.gz` .tar.gz) to PyPI! -- \033[0m" twine upload dist/*.tar.gz diff --git a/test/pkg_smoke.sh b/test/pkg_smoke.sh index 78811be..6349e59 100644 --- a/test/pkg_smoke.sh +++ b/test/pkg_smoke.sh @@ -21,7 +21,10 @@ cp "$LIB" "$SRC/genomicsqlite/$QDIR/" # version.py wants git describe (unavailable in the staged copy) or this file [ -f "$SRC/RELEASE-VERSION" ] || echo "0.0.0" > "$SRC/RELEASE-VERSION" SITE="$WORK/site" -"$PY" -m pip install --quiet --no-build-isolation --target "$SITE" "$SRC" +# Install the sdist, not the source directory: the tarball is the shipped +# artifact, and building it is the step that can drop package modules. +( cd "$SRC" && "$PY" setup.py sdist --dist-dir "$WORK/dist" ) +"$PY" -m pip install --quiet --no-build-isolation --target "$SITE" "$WORK"/dist/*.tar.gz echo "installed bundled libraries:"; ls "$SITE/genomicsqlite/$QDIR" cd "$WORK" # neutral cwd: the repo tree must not shadow the installed package @@ -40,3 +43,8 @@ OUT="$(env -u LIBGENOMICSQLITE PYTHONPATH="$SITE" PATH="$SHELLDIR:$PATH" \ echo "$OUT" [ "$OUT" = "CLI:pkg-ok" ] || { echo "CLI smoke output mismatch" >&2; exit 1; } echo "CLI SMOKE OK" + +# Exercise the .dbi helper end-to-end (sqlite_web_dbi.py in the installed package) +env -u LIBGENOMICSQLITE PYTHONPATH="$SITE" "$PY" -m genomicsqlite "$DB" --dbi +[ -f "$DB.dbi" ] || { echo "missing $DB.dbi" >&2; exit 1; } +echo "DBI SMOKE OK"