[POC] Improve importlib.metadata
usage
#2456
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: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
env: | |
PYTHON_VERSION: '3.12' | |
# renovate: datasource=pypi depName=uv | |
UV_VERSION: '0.4.10' | |
jobs: | |
quality: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
version: ${{ env.UV_VERSION }} | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Python dependencies | |
run: uv sync --frozen --no-install-project | |
- name: Setup Rust toolchain | |
run: rustup component add clippy rustfmt | |
- name: Run pre-commit | |
run: uvx pre-commit@${{ env.PRE_COMMIT_VERSION }} run -a --show-diff-on-failure | |
env: | |
# renovate: datasource=pypi depName=pre-commit | |
PRE_COMMIT_VERSION: '3.8.0' | |
- name: Inspect dependencies with deptry | |
run: uv run deptry python | |
tests: | |
strategy: | |
matrix: | |
os: | |
- name: linux | |
image: ubuntu-24.04 | |
- name: macos | |
image: macos-14 | |
- name: windows | |
image: windows-2022 | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev', 'pypy3.10'] | |
fail-fast: false | |
runs-on: ${{ matrix.os.image }} | |
name: ${{ matrix.os.name }} (${{ matrix.python-version }}) | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
version: ${{ env.UV_VERSION }} | |
enable-cache: 'true' | |
cache-suffix: ${{ matrix.python-version }} | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python dependencies | |
run: uv sync --frozen | |
# - name: Check typing | |
# run: uv run mypy | |
# if: ${{ matrix.os.name == 'linux' }} | |
# | |
# - name: Run unit tests | |
# run: uv run pytest tests/unit --cov --cov-config=pyproject.toml --cov-report=xml | |
- name: Run functional tests | |
run: uv run pytest tests/functional -n auto --dist loadgroup | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
if: ${{ matrix.os.name == 'linux' && matrix.python-version == '3.12' }} | |
check-docs: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v2 | |
with: | |
version: ${{ env.UV_VERSION }} | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Python dependencies | |
run: uv sync --frozen --no-install-project | |
- name: Check if documentation can be built | |
# `--no-project` is a workaround to avoid the installation of deptry | |
# itself (https://github.com/astral-sh/uv/issues/6578) | |
run: uv run --no-project mkdocs build --strict |