Remove Python 3.7 support and update dependencies #70
Workflow file for this run
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: test nornir_rich | |
on: [push,pull_request] | |
jobs: | |
linters: | |
name: linters | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v4 | |
id: cached-poetry-dependencies | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install Dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Run black | |
run: make black | |
- name: Run mypy | |
run: make mypy | |
pytest: | |
name: Testing on Python ${{ matrix.python-version }} (${{ matrix.platform}}) | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
platform: [ubuntu-latest, macos-13, windows-2019] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v4 | |
id: cached-poetry-dependencies | |
with: | |
path: .venv | |
key: venv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
if: ${{ matrix.platform != 'windows-2019' }} # windows hangs if using a cached venv | |
- name: Install Dependencies | |
run: poetry install --no-interaction --no-root | |
- name: Poetry show | |
run: poetry show | |
- name: Poetry env info | |
run: poetry env info | |
- name: Force using UTF-8 encoding for windows tests | |
run: poetry run python -m pytest -vs | |
if: ${{ matrix.platform == 'windows-2019' }} | |
env: | |
PYTHONIOENCODING: utf-8 | |
- name: Run pytest | |
run: make pytest | |
if: ${{ matrix.platform != 'windows-2019' }} | |
release: | |
name: Releasing to pypi | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
needs: [linters, pytest] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: prepare release | |
run: make fiximageurls | |
- name: build release | |
run: poetry build | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: dist/* |