Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Add smoke test of wheels #813

Merged
merged 5 commits into from
May 10, 2024
Merged
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
43 changes: 39 additions & 4 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ jobs:
name: sdist_files
path: dist/*.tar.gz

publish_wheels:
permissions:
id-token: write
name: Publish wheels on pypi

assemble_wheels:
name: Combine wheels
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
Expand All @@ -134,6 +133,42 @@ jobs:
path: ./dist/*
name: collected_dist_files

test_wheels:
name: Test Wheels
needs: [assemble_wheels]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-12, macos-latest]
python-version: ["3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/download-artifact@v4
with:
name: collected_dist_files
path: wheelhouse
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install guidance -f ./wheelhouse/
name: Install guidance from wheels
- run: pip install transformers torch
name: Other installs
- run: python -c "import guidance; lm = guidance.models.Transformers('gpt2'); lm += '1,2,3,4,5,' + guidance.gen('num', max_tokens=5, temperature=0); print(f'\n{str(lm)=}\n'); assert lm['num'].startswith('6')"
name: Run smoke test
Comment on lines +157 to +158
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that we have this from the wheel installation


publish_wheels:
permissions:
id-token: write
name: Publish wheels on pypi
needs: [test_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: collected_dist_files
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags')
Expand Down
Loading