Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 48 additions & 55 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,108 +14,104 @@ on:

env:
FORCE_COLOR: "1"
PYTHON_LATEST: "3.11"
PYTHON_LATEST: "3.13"

jobs:
pre-commit:
name: "Pre-commit"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Locally install interrogate
run: python -m pip install .
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
run: |
uvx pre-commit run --all-files

tests:
name: "Python ${{ matrix.python-version }} on Ubuntu"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
cache: pip
python-version: ${{ matrix.python-version }}

- name: "Install dependencies"
run: |
python -VV
python -Im site
python -Im pip install --upgrade tox
- name: Run tox targets for ${{ matrix.python-version }}
run: python -Im tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
uv sync

- name: Run mypy
run: python -Im tox run -e mypy
if: matrix.python-version == '3.11'
- name: Run tox targets for ${{ matrix.python-version }}
run: uv run tox -f py$(echo ${{ matrix.python-version }} | tr -d .)

- name: Run mypy
run: python -Im tox run -e mypy
if: matrix.python-version == '3.11'
run: uv run tox run -e mypy
if: matrix.python-version == '3.13'

- name: Check MANIFEST.in
run: python -Im tox run -e manifest
if: matrix.python-version == '3.11'
run: uv run tox run -e manifest
if: matrix.python-version == '3.13'

- name: Upload coverage data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-data
name: coverage-data-${{ matrix.python-version }}
path: ".coverage.*"
if-no-files-found: ignore
include-hidden-files: true

coverage:
runs-on: ubuntu-latest
needs: tests

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
# Use latest Python, so it understands all syntax.
python-version: ${{env.PYTHON_LATEST}}
cache: pip

- run: python -Im pip install --upgrade coverage[toml]
- name: Install dependencies
run: uv sync

- name: Download coverage data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage-data
pattern: coverage-data-*
merge-multiple: true
- run: ls -R .

- name: "Combine coverage and fail if it's <98%."
run: |
python -Im coverage combine
uv run coverage combine

python -Im coverage html --skip-covered --skip-empty
uv run coverage html --skip-covered --skip-empty

# Report and write to summary.
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
uv run coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
# Report again and fail if under 98%.
python -Im coverage report --fail-under=98
uv run coverage report --fail-under=98
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
include-hidden-files: true
if: ${{ failure() }}

build-package:
name: Build & verify package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v1
- uses: hynek/build-and-inspect-python-package@v2

install-dev:
name: "Verify Dev Env on ${{ matrix.os }}"
Expand All @@ -124,16 +120,15 @@ jobs:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
runs-on: "${{ matrix.os }}"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{env.PYTHON_LATEST}}
- name: "Install in dev mode"
run: "python -Im pip install -e .[dev]"
- name: "Import package"
run: "python -Ic 'import interrogate; print(interrogate.__version__)'"
run: echo 'import interrogate; print(interrogate.__version__)' | uv run -
- name: "Create a badge"
run: interrogate --config pyproject.toml --generate-badge . src tests
run: uv run interrogate --config pyproject.toml --generate-badge . src tests
if: runner.os != 'Windows'
env:
# TODO: set for only macos
Expand All @@ -143,15 +138,13 @@ jobs:
name: Check docs
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
- uses: actions/setup-python@v4
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
# Keep in sync with tox.ini/docs & .readthedocs.yaml
python-version: "3.11"
cache: pip
- run: python -Im pip install tox
python-version: ${{env.PYTHON_LATEST}}

- run: python -Im tox run -e docs
- run: uv run tox run -e docs

# Ensure everything required is passing for branch protection.
required-checks-pass:
Expand Down
42 changes: 17 additions & 25 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,49 @@ on:
env:
FORCE_COLOR: "1"
TOX_TESTENV_PASSENV: FORCE_COLOR
PYTHON_LATEST: "3.10"
PYTHON_LATEST: "3.13"

jobs:
tests:
name: "Python ${{ matrix.python-version }} on Ubuntu"
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
cache: pip

- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade virtualenv tox tox-gh-actions
- name: "Run tox targets for ${{ matrix.python-version }}"
run: "python -m tox"
run: uv run tox -f py$(echo ${{ matrix.python-version }} | tr -d .)

package:
name: "Build & Verify Package on Ubuntu"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{env.PYTHON_LATEST}}
- run: python -m pip install build twine check-wheel-contents
- run: python -m build --sdist --wheel .
- run: uv build --sdist --wheel
- run: ls -l dist
- run: check-wheel-contents dist/*.whl
- run: uvx check-wheel-contents dist/*.whl
- name: Check long_description
run: python -m twine check dist/*
run: uvx twine check dist/*

install-dev:
name: "Verify Dev Env on Ubuntu"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{env.PYTHON_LATEST}}
- name: "Install in dev mode"
run: "python -m pip install -e .[dev]"
run: uv run -m pip install -e .[dev]
- name: "Import package"
run: "python -c 'import interrogate; print(interrogate.__version__)'"
run: echo 'import interrogate; print(interrogate.__version__)' | uv run -
15 changes: 6 additions & 9 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ jobs:
runs-on: "windows-latest"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
cache: pip
- run: python -Im pip install --upgrade tox

python-version: ${{ matrix.python-version }}
- name: Run tests on ${{ matrix.python-version }} sans PNG
run: python -Im tox -e py$(echo ${{ matrix.python-version }} | tr -d .)
run: uv run tox -e py$(echo ${{ matrix.python-version }} | tr -d .)
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
args: [--py38-plus]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 6.0.1
hooks:
- id: isort
additional_dependencies: [toml]
Expand All @@ -35,7 +35,7 @@ repos:
exclude: ^(tests/functional/sample)

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build:
os: ubuntu-22.04
tools:
# Keep version in sync with main.yml/docs & tox.ini/docs.
python: "3.11"
python: "3.13"

python:
install:
Expand Down
40 changes: 40 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run",
"type": "debugpy",
"request": "launch",
"module": "interrogate",
"args": [],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Unit test",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/.venv/bin/pytest",
"args": [
"tests/unit",
"--maxfail=1",
"--disable-warnings"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Functional test",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/.venv/bin/pytest",
"args": [
"tests/functional",
"--maxfail=1",
"--disable-warnings"
],
"console": "integratedTerminal",
"justMyCode": true
}
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"python.testing.pytestArgs": [
"tests",
"tests/functional",
"tests/unit",
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
}
Loading