diff --git a/.github/workflows/pr-flowvault.yml b/.github/workflows/pr-flowvault.yml index 0ff1241..5b44ed3 100644 --- a/.github/workflows/pr-flowvault.yml +++ b/.github/workflows/pr-flowvault.yml @@ -82,3 +82,33 @@ jobs: flags: flowvault name: codecov-skyflow-python-flowvault verbose: true + + smoke: + name: Clean-install smoke test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v2 + with: + python-version: '3.9' + + # Build the wheel (it bundles the sibling common/ tree via setup.py's + # custom build_py), then install ONLY that wheel into a fresh virtualenv + # and import it. The venv contains just the wheel's declared runtime + # dependencies, so a dependency missing from setup.py fails the import + # here -- the unit-test job installs dev deps and would mask it. + - name: Build the flowvault wheel + run: | + python -m pip install --upgrade pip setuptools wheel + cd flowvault + python setup.py bdist_wheel + + - name: Install the wheel in a clean venv and import + run: | + python -m venv /tmp/smoke + /tmp/smoke/bin/pip install --upgrade pip + /tmp/smoke/bin/pip install flowvault/dist/*.whl + # Import from outside the repo so the source tree (flowvault/skyflow, + # ./common) is not on sys.path -- this exercises the installed wheel. + cd /tmp + /tmp/smoke/bin/python -c "import skyflow, common; from skyflow import Skyflow, Env, LogLevel; from skyflow.vault.data import InsertRequest, GetRequest, UpdateRequest, DeleteRequest, DetokenizeRequest, InsertOptions, GetOptions, UpdateOptions, DeleteOptions, DetokenizeOptions; from skyflow.vault.controller import VaultController; print('clean-install import OK')" diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index 7b142de..4bbcab5 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -123,6 +123,28 @@ jobs: cd "$MODULE" python setup.py sdist bdist_wheel + # Gate: install each freshly built artifact into its own clean virtualenv + # (only the package's DECLARED runtime deps present) and import it from + # outside the repo. This runs before either publish step and even on a + # dry run, so a missing runtime dependency in setup.py or a + # non-self-contained sdist fails here rather than shipping a broken + # release (both packages import as `skyflow` and bundle `common`). + - name: Smoke test the built package (clean install + import) + run: | + set -e + WHEEL=$(ls "$MODULE"/dist/*.whl) + SDIST=$(ls "$MODULE"/dist/*.tar.gz) + + python -m venv /tmp/smoke-wheel + /tmp/smoke-wheel/bin/pip install --upgrade pip + /tmp/smoke-wheel/bin/pip install "$WHEEL" + (cd /tmp && /tmp/smoke-wheel/bin/python -c "import skyflow, common; from skyflow import Skyflow, Env, LogLevel; print('wheel clean-install import OK')") + + python -m venv /tmp/smoke-sdist + /tmp/smoke-sdist/bin/pip install --upgrade pip setuptools wheel + /tmp/smoke-sdist/bin/pip install "$SDIST" + (cd /tmp && /tmp/smoke-sdist/bin/python -c "import skyflow, common; from skyflow import Skyflow, Env, LogLevel; print('sdist clean-install import OK')") + - name: Publish to PyPI if: ${{ (inputs.tag == 'beta' || inputs.tag == 'public') && inputs.dry-run != true }} env: diff --git a/flowvault/setup.py b/flowvault/setup.py index 6dd86cf..f9d4a0a 100644 --- a/flowvault/setup.py +++ b/flowvault/setup.py @@ -89,6 +89,7 @@ def run(self): 'PyJWT >= 2.12, < 3', 'cryptography >= 44.0.2', 'httpx >= 0.21.2', + 'python-dotenv >= 1.1.0, < 2', # NOTE: 'requests' intentionally omitted -- only used today by v2's Connection # controller, which isn't part of v3's scope this round. ],