Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions .github/workflows/_package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,36 @@ jobs:
GIT_CLIFF_CHANGELOG: ${{ steps.git-cliff.outputs.changelog }}
run: cat "$GIT_CLIFF_CHANGELOG"

- name: Build distribution into dist/
- name: Verify lockstep versioning
shell: bash
run: make dist
run: |
SDK_VERSION=$(grep '^version = ' packages/aignostics-sdk/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
FULL_VERSION=$(grep '^version = ' packages/aignostics/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
if [ "$SDK_VERSION" != "$FULL_VERSION" ]; then
echo "❌ Version mismatch: aignostics-sdk=$SDK_VERSION, aignostics=$FULL_VERSION"
exit 1
fi
echo "✅ Versions match: $SDK_VERSION"

- name: Publish distribution to Python Package Index at pypi.org
- name: Build aignostics-sdk distribution
shell: bash
run: uv build --package aignostics-sdk --out-dir dist/

- name: Publish aignostics-sdk to PyPI
shell: bash
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
run: |
# Use uv's credential storage - uv will read from UV_PUBLISH_TOKEN env var automatically
uv publish
run: uv publish dist/aignostics_sdk-*

- name: Build aignostics distribution
shell: bash
run: uv build --package aignostics --out-dir dist/
Comment on lines +189 to +197

- name: Publish aignostics to PyPI
shell: bash
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
run: uv publish dist/aignostics-*

- name: Download test results for ubuntu-latest generated in _test.yml
if: |
Expand Down Expand Up @@ -276,3 +295,25 @@ jobs:
# See https://github.com/cli/cli/discussions/10696
gh api repos/aignostics/python-sdk/dispatches \
-f event_type=release_created_programatically

smoke_test_slim:
runs-on: ubuntu-latest
needs: package_publish
continue-on-error: true
steps:
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0

- name: Smoke test aignostics-sdk
shell: bash
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
uv venv /tmp/slim-venv
uv pip install --python /tmp/slim-venv/bin/python "aignostics-sdk==$VERSION"
/tmp/slim-venv/bin/aignostics-sdk --help
/tmp/slim-venv/bin/python -c "from aignostics_sdk.platform import Client; print('✅ slim import OK')"
if /tmp/slim-venv/bin/python -c "import openslide" 2>/dev/null; then
echo "❌ openslide should not be installed in slim package"
exit 1
fi
echo "✅ Heavy deps correctly absent"
5 changes: 3 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,5 +1027,6 @@ def act(session: nox.Session) -> None:

@nox.session()
def dist(session: nox.Session) -> None:
"""Build wheel and put in dist/."""
session.run("uv", "build", external=True)
"""Build wheels for both packages into dist/."""
session.run("uv", "build", "--package", "aignostics-sdk", "--out-dir", "dist/", external=True)
session.run("uv", "build", "--package", "aignostics", "--out-dir", "dist/", external=True)