Add test for rust estimator parser matches pure python implementation #36
This file contains 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: Build and deploy to PyPI | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
release: | |
types: [published, edited] | |
repository_dispatch: | |
types: [trigger_checks] | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-24.04, macos-13, macos-14] | |
fail-fast: false | |
env: | |
CIBW_ENVIRONMENT_PASS_LINUX: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade uv | |
python3 -m uv pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust wheel twine build | |
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev)" >> $GITHUB_ENV | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust wheel twine build | |
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev)" >> $GITHUB_ENV | |
- name: Build sdist | |
run: | | |
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev) | |
python3 -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
deploy: | |
name: Upload to PyPI | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-24.04 | |
environment: test | |
permissions: | |
id-token: write | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade uv | |
python3 -m uv pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust wheel twine build | |
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev)" >> $GITHUB_ENV | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
verbose: false |