Skip to content

Update uv-build requirement from <0.11.0,>=0.7.20 to >=0.7.20,<0.12.0 #577

Update uv-build requirement from <0.11.0,>=0.7.20 to >=0.7.20,<0.12.0

Update uv-build requirement from <0.11.0,>=0.7.20 to >=0.7.20,<0.12.0 #577

Workflow file for this run

# Run testing, linting and type-checking for Python code
# * uv as dependency manager
# * pytest for testing
# * ruff for linting
# * mypy for type-checking
#
# Testing is run across many platforms and Python versions
# All others are just run on Ubuntu with latest compatible Python
name: Test and Lint
on:
pull_request:
branches:
- main
push:
branches:
- main
# Yoinked from https://github.com/MTES-MCT/apilos/pull/854/files
# Explicitely set permissions to allow Dependabot workflow runs to write in the PR
# for coverage's reporting.
# By default, these are read-only when the actions are ran by Dependabot
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#changing-github_token-permissions
permissions:
contents: read
pull-requests: write
jobs:
# Run test suite with coverage
Test:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-latest"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Test with pytest
run: |
uv run pytest
# Only run coverage once
Coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
# Pinned Python version
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Pytest with coverage
run: |
uv run coverage run -m pytest
- name: Print coverage output
run: |
uv run coverage report
- name: Generate code coverage report
if: ${{ github.event_name == 'pull_request' }}
run: |
uv run coverage xml
- name: Create code coverage comment
if: ${{ github.event_name == 'pull_request' }}
uses: orgoro/coverage@v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
# Run linting
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
# Pinned Python version
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Lint with ruff
run: |
uv run ruff check
# Run type-checking with mypy
Type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
# Pinned Python version
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Type-check with mypy
run: |
uv run mypy