diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 48f9e10b0..a88a80f3e 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -51,7 +51,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3
+ uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -62,7 +62,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3
+ uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -76,4 +76,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3
+ uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index 4ba98033d..070b5ff07 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -19,6 +19,7 @@ permissions:
jobs:
dependency-review:
+ name: "Review dependencies"
if: github.repository_owner == 'nedbat'
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml
index 0fd0534ea..9447a651a 100644
--- a/.github/workflows/kit.yml
+++ b/.github/workflows/kit.yml
@@ -324,7 +324,7 @@ jobs:
files=$(ls coverage-* 2>/dev/null | wc -l) && [ "$files" -eq $EXPECTED ] || exit 1
- name: "Sign artifacts"
- uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
+ uses: sigstore/gh-action-sigstore-python@f7ad0af51a5648d09a20d00370f0a91c3bdf8f84 # v3.0.1
with:
inputs: coverage-*.*
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 7533c9840..18a393302 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -81,7 +81,7 @@ jobs:
files=$(ls dist 2>/dev/null | wc -l) && [ "$files" -eq $EXPECTED ] || exit 1
- name: "Generate attestations"
- uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
+ uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
with:
subject-path: "dist/*"
@@ -121,7 +121,7 @@ jobs:
files=$(ls dist 2>/dev/null | wc -l) && [ "$files" -eq $EXPECTED ] || exit 1
- name: "Generate attestations"
- uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
+ uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
with:
subject-path: "dist/*"
diff --git a/.github/workflows/python-nightly.yml b/.github/workflows/python-nightly.yml
index c6dc6a7f3..6eaee452d 100644
--- a/.github/workflows/python-nightly.yml
+++ b/.github/workflows/python-nightly.yml
@@ -31,52 +31,29 @@ concurrency:
jobs:
tests:
- name: "${{ matrix.python-version }}${{ matrix.nogil && ' nogil' || '' }} on ${{ matrix.os-short }}"
+ name: "${{ matrix.python-version }}"
runs-on: "${{ matrix.os }}"
# If it doesn't finish in an hour, it's not going to. Don't spin for six
# hours needlessly.
timeout-minutes: 60
env:
- TOX_GH_MAJOR_MINOR: "${{ matrix.python-version }}${{ matrix.nogil && 't' || '' }}"
+ TOX_GH_MAJOR_MINOR: "${{ matrix.python-version }}"
strategy:
matrix:
os:
- # Choose a recent Ubuntu that deadsnakes still builds all the versions for.
- # For example, deadsnakes doesn't provide 3.10 nightly for 22.04 (jammy)
- # because jammy ships 3.10, and deadsnakes doesn't want to clobber it.
- # https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly/+packages
- # https://github.com/deadsnakes/issues/issues/234
- # See https://github.com/deadsnakes/nightly for the source of the nightly
- # builds.
- # bionic: 18, focal: 20, jammy: 22, noble: 24
- - "ubuntu-22.04"
- os-short:
- - "ubuntu"
+ - "ubuntu-latest"
python-version:
# When changing this list, be sure to check the [gh] list in
# tox.ini so that tox will run properly. PYVERSIONS
- # Available versions:
- # https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly/+packages
- "3.12"
- "3.13"
+ - "3.13t"
- "3.14"
+ - "3.14t"
- "3.15"
- # https://github.com/actions/setup-python#available-versions-of-pypy
- - "pypy-3.11"
- nogil:
- - false
- - true
- # include:
- # - python-version: "pypy-3.11"
- # os: "windows-latest"
- # os-short: "windows"
- exclude:
- - python-version: "3.12"
- nogil: true
- - python-version: "pypy-3.11"
- nogil: true
+ - "3.15t"
fail-fast: false
@@ -86,18 +63,28 @@ jobs:
with:
persist-credentials: false
- - name: "Install ${{ matrix.python-version }} with deadsnakes"
- uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
- if: "!startsWith(matrix.python-version, 'pypy-')"
- with:
- python-version: "${{ matrix.python-version }}-dev"
- nogil: "${{ matrix.nogil || false }}"
+ - name: "Install system dependencies"
+ run: |
+ sudo sed -i.bak 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
+ sudo apt-get update
+ sudo apt-get build-dep -y python3
- - name: "Install ${{ matrix.python-version }} with setup-python"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- if: "startsWith(matrix.python-version, 'pypy-')"
- with:
- python-version: "${{ matrix.python-version }}-nightly"
+ - name: "Install pyenv"
+ run: |
+ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
+
+ - name: "Build Python ${{ matrix.python-version }}-dev"
+ env:
+ PYVER: "${{ matrix.python-version }}-dev"
+ #PYTHON_CONFIGURE_OPTS: "--enable-shared --disable-test-modules"
+ run: |
+ set -xe
+ export PYENV_ROOT="$HOME/.pyenv"
+ export PATH="$PYENV_ROOT/bin:$PATH"
+ echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
+ pyenv install $PYVER -v
+ pyenv global $PYVER
+ pyenv rehash
- name: "Show diagnostic info"
run: |
@@ -110,21 +97,15 @@ jobs:
python -m coverage debug pybehave
env | sort
- - name: "Check build recency"
- shell: python
+ - name: "Check the Python version"
+ env:
+ EXPECTED: "${{ matrix.python-version }}"
run: |
- import platform
- from datetime import datetime
- for fmt in ["%b %d %Y %H:%M:%S", "%b %d %Y"]:
- try:
- built = datetime.strptime(platform.python_build()[1], fmt)
- except ValueError:
- continue
- days = (datetime.now() - built).days
- impl = platform.python_implementation()
- recency = 7 if (impl == "CPython") else 21
- print(f"Days since {impl} was built: {days}, need within {recency}")
- assert days <= recency
+ python -c "
+ import sys
+ assert sys.version.startswith('$EXPECTED'.strip('t'))
+ assert getattr(sys, '_is_gil_enabled', lambda: True)() == (not '$EXPECTED'.endswith('t'))
+ "
- name: "Install dependencies"
run: |
diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml
index 0e1650fed..fc2dbb273 100644
--- a/.github/workflows/quality.yml
+++ b/.github/workflows/quality.yml
@@ -173,7 +173,7 @@ jobs:
persist-credentials: false
- name: Install the latest version of uv
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb #v6.1.0
+ uses: astral-sh/setup-uv@445689ea25e0de0a23313031f5fe577c74ae45a1 #v6.3.0
with:
enable-cache: false
diff --git a/CHANGES.rst b/CHANGES.rst
index 909cc5c8a..19666e165 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -22,6 +22,21 @@ upgrading your version of coverage.py.
.. start-releases
+.. _changes_7-9-2:
+
+Version 7.9.2 â 2025-07-03
+--------------------------
+
+- Fix: complex conditionals within a line might cause a KeyError when using
+ sys.monitoring, as reported in `issue 1991`_. This is now fixed.
+
+- Fix: we can now measure coverage for code in Python archive (.par) files.
+ Thanks, `Itamer Oren
- coverage.py v7.9.1,
- created at 2025-06-13 08:29 -0400
+ coverage.py v7.9.2,
+ created at 2025-07-03 06:03 -0400
Classes