From f6450430f364892817a9b8d43103e8e28ed5d83f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 06:59:54 +0100 Subject: [PATCH 1/7] Bump the actions group with 2 updates (#292) Bumps the actions group with 2 updates: [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/download-artifact` from 6 to 7 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v6...v7) Updates `actions/upload-artifact` from 5 to 6 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pypi-package.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml index 885c30b..d3f6617 100644 --- a/.github/workflows/pypi-package.yml +++ b/.github/workflows/pypi-package.yml @@ -49,7 +49,7 @@ jobs: steps: - name: Download packages built by build-and-inspect-python-package - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: Packages path: dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b9875e..b0e3dbf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,7 +52,7 @@ jobs: run: | cat ./logs/docsbuild.log - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: doc-html-${{ matrix.python-version }} path: www/ From 2162e3228e68c297cfccdd3504d06f1dbb76848d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:40:27 +0200 Subject: [PATCH 2/7] [pre-commit.ci] pre-commit autoupdate (#294) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .pre-commit-config.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af1d14d..6ff7968 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.3 + rev: v0.14.10 hooks: - - id: ruff + - id: ruff-check args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.10.0 + rev: 25.12.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-case-conflict - id: check-merge-conflict @@ -22,28 +22,28 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.36.0 hooks: - id: check-dependabot - id: check-github-workflows - repo: https://github.com/rhysd/actionlint - rev: v1.7.7 + rev: v1.7.10 hooks: - id: actionlint - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.17.0 + rev: v1.19.0 hooks: - id: zizmor - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.5.0 + rev: v2.11.1 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.23 + rev: v0.24.1 hooks: - id: validate-pyproject From acc613399f73dc4e0f4dfb739eb0899a98cc6ad2 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 11 Jan 2026 18:42:54 +0200 Subject: [PATCH 3/7] Replace pre-commit with prek in CI (#293) --- .github/workflows/lint.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3a2f852..a8f03c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,4 @@ jobs: - uses: actions/checkout@v6 with: persist-credentials: false - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - - uses: pre-commit/action@v3.0.1 + - uses: j178/prek-action@v1 From 3434208c69c6b4744fee873c1cb5b45bb0dc6023 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Fri, 6 Feb 2026 17:22:57 +0000 Subject: [PATCH 4/7] Style codeblock `:caption:` (#288) Co-authored-by: Petr Viktorin --- python_docs_theme/static/pydoctheme.css | 19 +++++++++++++++++++ python_docs_theme/static/pydoctheme_dark.css | 6 ++++++ 2 files changed, 25 insertions(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index ec2d285..8c0ddfc 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -247,6 +247,25 @@ div.body { } } +div.code-block-caption { + background-color: #eee; + border: 1px solid #ac9; + border-bottom: none; + border-radius: 3px 3px 0 0; + padding: 0.3em 0.6em; + font-size: 90%; + color: #333; + + & + div pre { + border-top-left-radius: 0 !important; + border-top-right-radius: 0 !important; + } + + & + div .copybutton { + border-top-right-radius: 0 !important; + } +} + /* Admonitions */ :root { --admonition-background: #eee; diff --git a/python_docs_theme/static/pydoctheme_dark.css b/python_docs_theme/static/pydoctheme_dark.css index 582e4dd..909a296 100644 --- a/python_docs_theme/static/pydoctheme_dark.css +++ b/python_docs_theme/static/pydoctheme_dark.css @@ -97,6 +97,12 @@ div.body pre { border-color: #616161; } +div.code-block-caption { + background-color: #333; + border-color: #616161; + color: white; +} + code { background-color: #424242; } From 5d1ce7b6aba2e8c9aac57795226f3c584df830b7 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:47:44 +0200 Subject: [PATCH 5/7] Enable copy button for shell sessions and consoles (#295) --- python_docs_theme/static/copybutton.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python_docs_theme/static/copybutton.js b/python_docs_theme/static/copybutton.js index e1ad458..f90eb1e 100644 --- a/python_docs_theme/static/copybutton.js +++ b/python_docs_theme/static/copybutton.js @@ -62,6 +62,12 @@ const loadCopyButton = () => { + ".highlight-python3 .highlight," + ".highlight-pycon .highlight," + ".highlight-pycon3 .highlight," + + ".highlight-bash .highlight," + + ".highlight-console .highlight," + + ".highlight-doscon .highlight," + + ".highlight-ps1con .highlight," + + ".highlight-sh .highlight," + + ".highlight-shell-session .highlight," + ".highlight-default .highlight" ) From d075da5fe4aa2c2aa28f8ef9e3065fe440fcab28 Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Fri, 27 Feb 2026 15:30:34 +0100 Subject: [PATCH 6/7] Add colors for thread safety annotations (#297) --- python_docs_theme/static/pydoctheme.css | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 8c0ddfc..a83030a 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -444,6 +444,26 @@ div.footer a:hover { color: #229; } +/* C API thread safety annotations */ +:root { + --threadsafety-incompatible: var(--bad-color); + --threadsafety-compatible: var(--middle-color); + --threadsafety-safe: var(--good-color); +} + +.threadsafety.threadsafety-incompatible { + color: var(--threadsafety-incompatible); +} + +.threadsafety.threadsafety-compatible { + color: var(--threadsafety-compatible); +} + +.threadsafety.threadsafety-safe { + color: var(--threadsafety-safe); +} + + dl > dt span ~ em, .sig { font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; From 6aea65762f1e1ee339cf96b837377a5f917338b3 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 27 Feb 2026 16:57:38 +0200 Subject: [PATCH 7/7] Prepare 2026.2 release (#298) --- CHANGELOG.md | 6 ++++++ CONTRIBUTING.md | 5 +++-- python_docs_theme/__init__.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 069a114..0c28c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [2026.2](https://github.com/python/python-docs-theme/releases/tag/2026.2) + +* Style codeblock `:caption:` by @StanFromIreland in https://github.com/python/python-docs-theme/pull/288 +* Enable copy button for shell sessions and consoles by @hugovk in https://github.com/python/python-docs-theme/pull/295 +* Add colors for thread safety annotations by @lysnikolaou in https://github.com/python/python-docs-theme/pull/297 + ## [2025.12](https://github.com/python/python-docs-theme/releases/tag/2025.12) * Add support for green, red and yellow side borders for code examples by @hugovk in https://github.com/python/python-docs-theme/pull/285 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f26b902..4ca0f05 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,9 +7,10 @@ [GitHub Actions](https://github.com/python/python-docs-theme/actions) - Go to https://github.com/python/python-docs-theme/releases - Click "Draft a new release" -- Click "Choose a tag" +- Click "Tag: Select tag" - Type the next YYYY.MM version (no leading zero) and - select "**Create new tag: YYYY.MM** on publish" + select "Create new tag" +- Click "Create" for "YYYY.MM will be created on publish" - Leave the "Release title" blank (it will be autofilled) - Click "Generate release notes" and amend as required - Click "Publish release" diff --git a/python_docs_theme/__init__.py b/python_docs_theme/__init__.py index a6c8f18..026329b 100644 --- a/python_docs_theme/__init__.py +++ b/python_docs_theme/__init__.py @@ -11,7 +11,7 @@ from sphinx.application import Sphinx from sphinx.util.typing import ExtensionMetadata -__version__ = "2025.12" +__version__ = "2026.2" THEME_PATH = Path(__file__).resolve().parent LOCALE_DIR = THEME_PATH / "locale"