chore(deps-py): bump hypothesis from 6.168.0 to 6.168.3 in the dev gr… #1088
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pure Python wheels 🐍 | |
| # Builds and publishes the pure wheels on pypi. | |
| # | |
| # This does not include the main `tket-py` package, which is built using maturin. | |
| # See `python-wheels.yml` for that workflow. | |
| # | |
| # When running on a tag push matching `{package}-v*`, | |
| # this workflow will publish the wheels to pypi. | |
| # If the version is already published, pypi just ignores it. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "tket-eccs-v*" | |
| - "tket-exts-v*" | |
| env: | |
| # Pinned version for the uv package manager | |
| UV_VERSION: "0.11.15" | |
| jobs: | |
| # Check if the tag matches the package name, | |
| # or if the workflow is running on a non-tag event. | |
| check-tag: | |
| name: Check tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_exts: ${{ steps.check-tag.outputs.run_exts }} | |
| run_eccs: ${{ steps.check-tag.outputs.run_eccs }} | |
| steps: | |
| - name: Check tag | |
| id: check-tag | |
| run: | | |
| echo "run_exts=$RUN_EXTS" >> $GITHUB_OUTPUT | |
| echo "run_eccs=$RUN_ECCS" >> $GITHUB_OUTPUT | |
| env: | |
| RUN_EXTS: ${{ github.ref_type != 'tag' || startsWith(github.ref, 'refs/tags/tket-exts-v') }} | |
| RUN_ECCS: ${{ github.ref_type != 'tag' || startsWith(github.ref, 'refs/tags/tket-eccs-v') }} | |
| build: | |
| name: Build and test wheels | |
| needs: check-tag | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - dir: tket/tket-eccs | |
| name: tket_eccs | |
| run: ${{ needs.check-tag.outputs.run_eccs }} | |
| - dir: tket/tket-exts | |
| name: tket_exts | |
| run: ${{ needs.check-tag.outputs.run_exts }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| if: ${{ matrix.target.run == 'true' }} | |
| - name: Run sccache-cache | |
| if: ${{ matrix.target.run == 'true' }} | |
| uses: mozilla-actions/sccache-action@v0.0.11 | |
| - name: Set up uv | |
| if: ${{ matrix.target.run == 'true' }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: ${{ env.UV_VERSION }} | |
| enable-cache: true | |
| - name: Install Python 3.13 | |
| run: uv python install 3.13 | |
| if: ${{ matrix.target.run == 'true' }} | |
| - name: Build sdist and wheels | |
| if: ${{ matrix.target.run == 'true' }} | |
| run: | | |
| cd ${{ matrix.target.dir }} | |
| uvx --from build pyproject-build --installer uv --outdir ../../dist | |
| - name: Upload the built packages as artifacts | |
| if: ${{ matrix.target.run == 'true' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-${{ matrix.target.name }}-sdist | |
| path: | | |
| dist/*.tar.gz | |
| dist/*.whl | |
| - name: Test installing the built wheels | |
| if: ${{ matrix.target.run == 'true' }} | |
| run: | | |
| echo "Testing the newly built ${{ matrix.target.name }} wheels..." | |
| uv run -f dist --with ${{ matrix.target.name }} --refresh-package ${{ matrix.target.name }} --no-project -- python -c "import ${{ matrix.target.name }}" | |
| uvx twine check --strict dist/* | |
| release: | |
| name: Release | |
| needs: [check-tag, build] | |
| runs-on: ubuntu-latest | |
| if: ${{ github.ref_type == 'tag' && (startsWith(github.ref, 'refs/tags/tket-eccs-v') || startsWith(github.ref, 'refs/tags/tket-exts-v')) }} | |
| environment: release | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| # Used to upload release artifacts | |
| contents: write | |
| # Used to generate artifact attestation | |
| attestations: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Check if the tag has an associated release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if ! gh release view ${{ github.ref_name }}; then | |
| echo "No release found for tag ${{ github.ref_name }}" | |
| exit 1 | |
| fi | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Generate artifact attestation | |
| uses: actions/attest@v4.2.2 | |
| with: | |
| subject-path: "dist/*" | |
| - name: Report | |
| run: | | |
| echo "Publishing to PyPI..." | |
| echo "Based on the following workflow variables, this is a new version tag push:" | |
| echo " - event_name: ${{ github.event_name }}" | |
| echo " - ref_type: ${{ github.ref_type }}" | |
| echo " - ref: ${{ github.ref }}" | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| skip-existing: true | |
| - name: Upload wheels to the release and un-draft it | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Upload wheels to the release assets | |
| gh release upload ${{ github.ref_name }} dist/* | |
| # Un-draft the release on GitHub now that the package has been published to PyPI | |
| gh release edit ${{ github.ref_name }} --draft=false |