Update dependencies and drop support for Python < 3.10 #155
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: ci | |
on: | |
pull_request: | |
branches: | |
- master | |
release: | |
types: ["published"] | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: 3.10.4 | |
- name: Restore cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: .venv | |
key: py3.10-ubuntu-latest-venv-cache-${{ hashFiles('**/poetry.lock') }} | |
- name: Install poetry | |
run: | | |
pip install poetry>=1.8.4 | |
poetry config virtualenvs.in-project true | |
- name: Install dependencies | |
run: | | |
poetry install -E http -E sql | |
poetry run task compile | |
- name: Lint | |
run: | | |
poetry show mypy | |
poetry run task lint | |
build_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: 3.10.4 | |
- name: Restore cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: .venv | |
key: py3.10-ubuntu-latest-venv-cache-${{ hashFiles('**/poetry.lock') }} | |
- name: Install poetry | |
run: | | |
pip install poetry>=1.8.4 | |
poetry config virtualenvs.in-project true | |
- name: Install dependencies | |
run: | | |
poetry install -E http -E sql | |
poetry run task compile | |
poetry run task pytkdocs | |
- name: Build docs | |
run: poetry run mkdocs build | |
test_sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: 3.10.4 | |
- name: Restore cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: .venv | |
key: py3.10-ubuntu-latest-venv-cache-${{ hashFiles('**/poetry.lock') }} | |
- name: Install poetry | |
run: | | |
pip install poetry>=1.8.4 | |
poetry config virtualenvs.in-project true | |
- name: Install dependencies | |
run: | | |
poetry install -E http -E sql --no-root | |
poetry run task compile | |
poetry build -f sdist | |
poetry run pip install --ignore-installed dist/* | |
- name: Run tests | |
run: poetry run pytest -n 4 --mypy-ini-file=tests/mypy.ini | |
- name: Upload sdist | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
with: | |
name: sdist | |
path: dist/*.tar.gz | |
test_wheel: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ['3.10', '3.11'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: .venv | |
key: py${{ matrix.python-version }}-${{ matrix.os }}-venv-cache-${{ hashFiles('**/poetry.lock') }} | |
- name: Install poetry | |
run: | | |
pip install poetry>=1.8.4 | |
poetry config virtualenvs.in-project true | |
- name: Install dependencies | |
run: | | |
poetry install -E http -E sql --no-root | |
poetry run task compile | |
poetry build -f wheel | |
poetry run pip install --ignore-installed dist/* | |
- name: Run tests | |
run: poetry run pytest -n 4 --mypy-ini-file=tests/mypy.ini | |
- name: Upload wheel | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
with: | |
name: wheel-${{ matrix.os }}-py${{ matrix.python-version }} | |
path: dist/*.whl | |
release: | |
needs: [lint, build_docs, test_wheel, test_sdist] | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: 3.10.4 | |
- name: Restore cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: .venv | |
key: py3.10-ubuntu-latest-venv-cache-${{ hashFiles('**/poetry.lock') }} | |
- name: Install poetry | |
run: | | |
pip install poetry>=1.8.4 | |
poetry config virtualenvs.in-project true | |
- name: Download wheels and sdist | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
- name: Gather artifacts | |
run: | | |
mkdir dist | |
mv sdist/*.tar.gz dist | |
mv wheel-*/*.whl dist | |
- name: Install dependencies | |
run: | | |
poetry install -E http -E sql --no-root | |
poetry run task compile | |
poetry install | |
- name: Check version | |
run: | | |
tag=$(echo ${{ github.ref_name }} | cut -d / -f 3) | |
poetry run python scripts/check_version.py pyproject.toml $tag | |
- name: Release pfun | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
run: poetry publish | |
- name: Release docs | |
run: | | |
git fetch origin gh-pages | |
poetry run mkdocs gh-deploy |