diff --git a/.editorconfig b/.editorconfig index 586c7367..08936d99 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,9 @@ insert_final_newline = true indent_size = 4 charset = utf-8 +[*.py] +max_line_length = 140 + [*.{bat,cmd,ps1}] end_of_line = crlf diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b0ba059..b1f267e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,152 +60,170 @@ jobs: toxpython: 'python3.11' tox_env: 'docs' os: 'ubuntu-latest' - - name: 'py39-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'py39-pytest90-xdist38-coverage713 (ubuntu)' python: '3.9' toxpython: 'python3.9' python_arch: 'x64' - tox_env: 'py39-pytest84-xdist38-coverage710' + tox_env: 'py39-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'py39-pytest84-xdist38-coverage710 (windows)' + - name: 'py39-pytest90-xdist38-coverage713 (windows)' python: '3.9' toxpython: 'python3.9' python_arch: 'x64' - tox_env: 'py39-pytest84-xdist38-coverage710' + tox_env: 'py39-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'py39-pytest84-xdist38-coverage710 (macos)' + - name: 'py39-pytest90-xdist38-coverage713 (macos)' python: '3.9' toxpython: 'python3.9' python_arch: 'arm64' - tox_env: 'py39-pytest84-xdist38-coverage710' + tox_env: 'py39-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'py310-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'py310-pytest90-xdist38-coverage713 (ubuntu)' python: '3.10' toxpython: 'python3.10' python_arch: 'x64' - tox_env: 'py310-pytest84-xdist38-coverage710' + tox_env: 'py310-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'py310-pytest84-xdist38-coverage710 (windows)' + - name: 'py310-pytest90-xdist38-coverage713 (windows)' python: '3.10' toxpython: 'python3.10' python_arch: 'x64' - tox_env: 'py310-pytest84-xdist38-coverage710' + tox_env: 'py310-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'py310-pytest84-xdist38-coverage710 (macos)' + - name: 'py310-pytest90-xdist38-coverage713 (macos)' python: '3.10' toxpython: 'python3.10' python_arch: 'arm64' - tox_env: 'py310-pytest84-xdist38-coverage710' + tox_env: 'py310-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'py311-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'py311-pytest90-xdist38-coverage713 (ubuntu)' python: '3.11' toxpython: 'python3.11' python_arch: 'x64' - tox_env: 'py311-pytest84-xdist38-coverage710' + tox_env: 'py311-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'py311-pytest84-xdist38-coverage710 (windows)' + - name: 'py311-pytest90-xdist38-coverage713 (windows)' python: '3.11' toxpython: 'python3.11' python_arch: 'x64' - tox_env: 'py311-pytest84-xdist38-coverage710' + tox_env: 'py311-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'py311-pytest84-xdist38-coverage710 (macos)' + - name: 'py311-pytest90-xdist38-coverage713 (macos)' python: '3.11' toxpython: 'python3.11' python_arch: 'arm64' - tox_env: 'py311-pytest84-xdist38-coverage710' + tox_env: 'py311-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'py312-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'py312-pytest90-xdist38-coverage713 (ubuntu)' python: '3.12' toxpython: 'python3.12' python_arch: 'x64' - tox_env: 'py312-pytest84-xdist38-coverage710' + tox_env: 'py312-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'py312-pytest84-xdist38-coverage710 (windows)' + - name: 'py312-pytest90-xdist38-coverage713 (windows)' python: '3.12' toxpython: 'python3.12' python_arch: 'x64' - tox_env: 'py312-pytest84-xdist38-coverage710' + tox_env: 'py312-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'py312-pytest84-xdist38-coverage710 (macos)' + - name: 'py312-pytest90-xdist38-coverage713 (macos)' python: '3.12' toxpython: 'python3.12' python_arch: 'arm64' - tox_env: 'py312-pytest84-xdist38-coverage710' + tox_env: 'py312-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'py313-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'py313-pytest90-xdist38-coverage713 (ubuntu)' python: '3.13' toxpython: 'python3.13' python_arch: 'x64' - tox_env: 'py313-pytest84-xdist38-coverage710' + tox_env: 'py313-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'py313-pytest84-xdist38-coverage710 (windows)' + - name: 'py313-pytest90-xdist38-coverage713 (windows)' python: '3.13' toxpython: 'python3.13' python_arch: 'x64' - tox_env: 'py313-pytest84-xdist38-coverage710' + tox_env: 'py313-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'py313-pytest84-xdist38-coverage710 (macos)' + - name: 'py313-pytest90-xdist38-coverage713 (macos)' python: '3.13' toxpython: 'python3.13' python_arch: 'arm64' - tox_env: 'py313-pytest84-xdist38-coverage710' + tox_env: 'py313-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'pypy39-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'py314-pytest90-xdist38-coverage713 (ubuntu)' + python: '3.14' + toxpython: 'python3.14' + python_arch: 'x64' + tox_env: 'py314-pytest90-xdist38-coverage713' + os: 'ubuntu-latest' + - name: 'py314-pytest90-xdist38-coverage713 (windows)' + python: '3.14' + toxpython: 'python3.14' + python_arch: 'x64' + tox_env: 'py314-pytest90-xdist38-coverage713' + os: 'windows-latest' + - name: 'py314-pytest90-xdist38-coverage713 (macos)' + python: '3.14' + toxpython: 'python3.14' + python_arch: 'arm64' + tox_env: 'py314-pytest90-xdist38-coverage713' + os: 'macos-latest' + - name: 'pypy39-pytest90-xdist38-coverage713 (ubuntu)' python: 'pypy-3.9' toxpython: 'pypy3.9' python_arch: 'x64' - tox_env: 'pypy39-pytest84-xdist38-coverage710' + tox_env: 'pypy39-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'pypy39-pytest84-xdist38-coverage710 (windows)' + - name: 'pypy39-pytest90-xdist38-coverage713 (windows)' python: 'pypy-3.9' toxpython: 'pypy3.9' python_arch: 'x64' - tox_env: 'pypy39-pytest84-xdist38-coverage710' + tox_env: 'pypy39-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'pypy39-pytest84-xdist38-coverage710 (macos)' + - name: 'pypy39-pytest90-xdist38-coverage713 (macos)' python: 'pypy-3.9' toxpython: 'pypy3.9' python_arch: 'arm64' - tox_env: 'pypy39-pytest84-xdist38-coverage710' + tox_env: 'pypy39-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'pypy310-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'pypy310-pytest90-xdist38-coverage713 (ubuntu)' python: 'pypy-3.10' toxpython: 'pypy3.10' python_arch: 'x64' - tox_env: 'pypy310-pytest84-xdist38-coverage710' + tox_env: 'pypy310-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'pypy310-pytest84-xdist38-coverage710 (windows)' + - name: 'pypy310-pytest90-xdist38-coverage713 (windows)' python: 'pypy-3.10' toxpython: 'pypy3.10' python_arch: 'x64' - tox_env: 'pypy310-pytest84-xdist38-coverage710' + tox_env: 'pypy310-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'pypy310-pytest84-xdist38-coverage710 (macos)' + - name: 'pypy310-pytest90-xdist38-coverage713 (macos)' python: 'pypy-3.10' toxpython: 'pypy3.10' python_arch: 'arm64' - tox_env: 'pypy310-pytest84-xdist38-coverage710' + tox_env: 'pypy310-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'pypy311-pytest84-xdist38-coverage710 (ubuntu)' + - name: 'pypy311-pytest90-xdist38-coverage713 (ubuntu)' python: 'pypy-3.11' toxpython: 'pypy3.11' python_arch: 'x64' - tox_env: 'pypy311-pytest84-xdist38-coverage710' + tox_env: 'pypy311-pytest90-xdist38-coverage713' os: 'ubuntu-latest' - - name: 'pypy311-pytest84-xdist38-coverage710 (windows)' + - name: 'pypy311-pytest90-xdist38-coverage713 (windows)' python: 'pypy-3.11' toxpython: 'pypy3.11' python_arch: 'x64' - tox_env: 'pypy311-pytest84-xdist38-coverage710' + tox_env: 'pypy311-pytest90-xdist38-coverage713' os: 'windows-latest' - - name: 'pypy311-pytest84-xdist38-coverage710 (macos)' + - name: 'pypy311-pytest90-xdist38-coverage713 (macos)' python: 'pypy-3.11' toxpython: 'pypy3.11' python_arch: 'arm64' - tox_env: 'pypy311-pytest84-xdist38-coverage710' + tox_env: 'pypy311-pytest90-xdist38-coverage713' os: 'macos-latest' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions/setup-python@v6 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e8687d3d..f76d6a15 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ # To install the git pre-commit hooks run: -# pre-commit install --install-hooks +# prek install --install-hooks --overwrite # To update the versions: -# pre-commit autoupdate +# prek autoupdate exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)' # Note the order is intentional to avoid multiple passes of the hooks repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.12 + rev: v0.15.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes, --unsafe-fixes] diff --git a/.readthedocs.yml b/.readthedocs.yml index 009a913c..a2d480bb 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,7 +4,7 @@ sphinx: configuration: docs/conf.py formats: all build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: python: "3" python: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4524aad3..8a83194d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,25 @@ Changelog ========= +7.0.1 (2026-03-02) +------------------ + +* Fixed total coverage computation to always be consistent, regardless of reporting settings. + Previously some reports could produce different total counts, and consequently can make --cov-fail-under behave different depending on + reporting options. + See `#641 `_. + +* Improve handling of ResourceWarning from sqlite3. + + The plugin adds warning filter for sqlite3 ``ResourceWarning`` unclosed database (since 6.2.0). + It checks if there is already existing plugin for this message by comparing filter regular expression. + When filter is specified on command line the message is escaped and does not match an expected message. + A check for an escaped regular expression is added to handle this case. + + With this fix one can suppress ``ResourceWarning`` from sqlite3 from command line:: + + pytest -W "ignore:unclosed database in