Skip to content

fix python versions #28

fix python versions

fix python versions #28

Workflow file for this run

# This workflow will install Python dependencies,
# run tests and lint with a variety of Python versions
---
name: Tests
on: [push, pull_request]
jobs:
cpython:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13-dev', 3.14-dev]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[tests]"
- name: Test with pytest
run: |
pytest tests --cov=tests --cov=vercheck --cov-report=xml
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version==3.12 }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
static-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[typing, complexity, linting]"
- name: Typecheck
run: |
mypy vercheck tests
- name: Linting
run: |
flake8 vercheck tests --max-line-length=88
black --check vercheck tests
ruff check --no-fix vercheck tests
yamllint .github/workflows/
- name: Check complexity
run: |
radon cc --min B vercheck
radon mi --min B vercheck
lizard -l python -w vercheck
build-package:
name: Build & inspect our package.
runs-on: ubuntu-latest
needs: [cpython, static-tests]
steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check with pyroma
run: |
python -m pip install pyroma
pyroma .
- name: Check tag name
if: >-
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
run: |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
vercheck $GITHUB_REF_NAME
test-publish:
if: >-
github.event_name == 'push' &&
github.repository == 'cleder/vercheck' &&
startsWith(github.ref, 'refs/tags')
needs: build-package
name: Test install on TestPyPI
runs-on: ubuntu-latest
environment: test-release
permissions:
id-token: write
steps:
- name: Download packages built by build-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish:
if: >-
github.event_name == 'push' &&
github.repository == 'cleder/vercheck' &&
github.ref == 'refs/heads/main'
needs: build-package
name: Build and publish to PyPI and TestPyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Download packages built by build-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Publish distribution 📦 to PyPI for push to main
uses: pypa/gh-action-pypi-publish@release/v1
...