Correct misspelled class in __all__ #581
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, test and upload to PyPI | |
on: | |
push: | |
branches: | |
- master | |
- '[0-9]+.[0-9]+.X' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' | |
pull_request: | |
types: [opened, reopened] | |
jobs: | |
build_wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
pyver: [cp39, cp310, cp311, cp312] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.16.5 | |
env: | |
CIBW_BUILD: ${{matrix.pyver}}-* | |
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | |
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_x86_64 *-musllinux_i686" | |
CIBW_BEFORE_TEST: pip install -r {package}/requirements-test.txt | |
CIBW_TEST_COMMAND: python -m pytest {package}/tests --benchmark-skip | |
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: "3.9" | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
- name: Build sdist | |
run: | | |
python -m build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
# Check that a tag is annotated with a Release messages. | |
check_tag: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
outputs: | |
is_release: ${{ steps.is_release.outputs.is_release }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check that the tag is annotated with Release | |
id: is_release | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
TAG_MESSAGE=$(git tag -l --format='%(contents)' "$TAG_NAME" | head -n1) | |
if [[ $TAG_MESSAGE == [Rr]elease* ]]; then | |
echo "Tag $TAG_NAME is annotated for release ($TAG_MESSAGE)" | |
echo "is_release=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "Tag $TAG_NAME is not annotated for release ($TAG_MESSAGE)" | |
echo "is_release=false" >> "$GITHUB_OUTPUT" | |
fi | |
# Check if we should build the documentation for the current branch or tag | |
docs_version: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && ( github.ref_name == 'master' || startsWith(github.event.ref, 'refs/tags/v') ) }} | |
outputs: | |
version: ${{ steps.docs_version.outputs.version }} | |
build_docs: ${{ steps.docs_version.outputs.build_docs }} | |
steps: | |
- name: Extract the branch name | |
id: docs_version | |
run: | | |
REF_NAME="${{ github.ref_name }}" | |
VERSION_PATTERN="v([0-9]+\\.[0-9]+)\\.[0-9]+([a|b][0-9]+)?" # Matches major.minor from a version tag | |
# We build documentation for current master | |
if [[ "$REF_NAME" == "master" ]]; then | |
echo "Documentation is built for master" | |
echo "version=master" >> "$GITHUB_OUTPUT" | |
echo "build_docs=true" >> "$GITHUB_OUTPUT" | |
# And for tagged versions | |
elif [[ "$REF_NAME" =~ $VERSION_PATTERN ]]; then | |
VERSION="${BASH_REMATCH[1]}" | |
echo "Documentation is built for $VERSION" | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
echo "build_docs=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "Documentation is not build." | |
echo "build_docs=false" >> "$GITHUB_OUTPUT" | |
fi | |
build_docs: | |
needs: [docs_version, build_sdist, build_wheels] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && needs.docs_version.outputs.build_docs == 'true' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: "3.9" | |
- name: Install requirements | |
run: | | |
sudo apt-get install graphviz pandoc | |
python -m pip install --upgrade pip | |
python -m pip install -r docs/requirements.txt | |
- name: Install current version | |
run: | | |
pip install --force-reinstall . | |
pip install -r requirements-dev.txt | |
- name: Build docmentation | |
run: | | |
mkdir html | |
python -I -m sphinx docs html | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./html | |
destination_dir: ${{ needs.docs_version.outputs.version }} | |
upload_pypi: | |
needs: [build_wheels, build_sdist, build_docs] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |