Skip to content

Commit 151fda0

Browse files
Merge branch 'main' into 3.16-support
2 parents 066e0f9 + 2e0d368 commit 151fda0

20 files changed

Lines changed: 433 additions & 79 deletions

‎.github/workflows/lint.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1717
with:
1818
persist-credentials: false
19-
- uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2
19+
- uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0

‎.github/workflows/pypi-package.yml‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,12 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424
with:
2525
persist-credentials: false
26-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
26+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
2727

28-
- name: Compile translations
29-
run: |
30-
pip install --upgrade pip
31-
pip install -r requirements.txt
32-
python babel_runner.py compile
33-
34-
- uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # v2.17.0
28+
- uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1
3529

3630
# Upload to real PyPI on GitHub Releases.
3731
release-pypi:
@@ -55,4 +49,4 @@ jobs:
5549
path: dist
5650

5751
- name: Upload package to PyPI
58-
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
52+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

‎.github/workflows/tests.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
branch: "main"
2121
allow-prerelease: "true"
2222
steps:
23-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424
with:
2525
persist-credentials: false
26-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
26+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929
allow-prereleases: true
@@ -67,10 +67,10 @@ jobs:
6767
# Test minimum supported and latest stable from 3.x series
6868
python-version: ["3.12", "3"]
6969
steps:
70-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
70+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
7171
with:
7272
persist-credentials: false
73-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
73+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
7474
with:
7575
python-version: ${{ matrix.python-version }}
7676
allow-prereleases: true

‎.github/zizmor.yml‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎.pre-commit-config.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.15.9
3+
rev: v0.15.20
44
hooks:
55
- id: ruff-check
66
args: [--exit-non-zero-on-fix]
77

88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 26.3.1
9+
rev: 26.5.1
1010
hooks:
1111
- id: black
1212

@@ -22,7 +22,7 @@ repos:
2222
- id: trailing-whitespace
2323

2424
- repo: https://github.com/python-jsonschema/check-jsonschema
25-
rev: 0.37.1
25+
rev: 0.37.4
2626
hooks:
2727
- id: check-dependabot
2828
- id: check-github-workflows
@@ -33,12 +33,12 @@ repos:
3333
- id: actionlint
3434

3535
- repo: https://github.com/zizmorcore/zizmor-pre-commit
36-
rev: v1.23.1
36+
rev: v1.26.1
3737
hooks:
3838
- id: zizmor
3939

4040
- repo: https://github.com/tox-dev/pyproject-fmt
41-
rev: v2.21.0
41+
rev: v2.25.1
4242
hooks:
4343
- id: pyproject-fmt
4444

‎CHANGELOG.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [2026.9](https://github.com/python/python-docs-theme/releases/tag/2026.9)
4+
5+
* Add support for right-to-left page layout by @sepehr-rs in https://github.com/python/python-docs-theme/pull/324
6+
* Improve contrast between unvisited and visited links in dark mode
7+
by @StanFromIreland in https://github.com/python/python-docs-theme/pull/329
8+
* Keep breadcrumb navigation visible on mobile by @undeMalum in
9+
https://github.com/python/python-docs-theme/pull/326
10+
* Add Persian translation by @sepehr-rs in https://github.com/python/python-docs-theme/pull/322
11+
12+
## [2026.7](https://github.com/python/python-docs-theme/releases/tag/2026.7)
13+
14+
* Add Vietnamese translation by @StanFromIreland in https://github.com/python/python-docs-theme/pull/309
15+
* Switch to Hatchling build hooks for i18n packaging and exclude .po from wheels by @StanFromIreland in https://github.com/python/python-docs-theme/pull/312
16+
317
## [2026.4](https://github.com/python/python-docs-theme/releases/tag/2026.4)
418

519
* Add styling for the `soft-deprecated` class by @StanFromIreland

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# You can set these variables from the command line.
22
CPYTHON_PATH = ../cpython
33
PYTHON = python3
4-
PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz)
54
SPHINXOPTS =
65

76

@@ -15,10 +14,11 @@ help:
1514
.PHONY: venv
1615
venv:
1716
$(PYTHON) -m pip install build
17+
rm -rf dist/
1818
$(PYTHON) -m build
1919
cd $(CPYTHON_PATH)/Doc \
2020
&& make venv \
21-
&& ./venv/bin/pip install $(PACKAGE_ABS_PATH)
21+
&& ./venv/bin/pip install $(CURDIR)/dist/python_docs_theme-*.tar.gz
2222

2323
.PHONY: html
2424
html: venv

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ To use this theme, add the following to `conf.py`:
2222

2323
- `html_sidebars`, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
2424

25+
- To lay pages out right-to-left for languages such as Persian, Arabic, or Hebrew,
26+
set `html_theme_options = {"is_rtl": True}`. Defaults to `false`.
2527

2628
## Translation
2729

‎babel_runner.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import tomllib
99
from pathlib import Path
1010

11+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
12+
1113
# Global variables used by pybabel below (paths relative to PROJECT_DIR)
1214
DOMAIN = "python-docs-theme"
1315
COPYRIGHT_HOLDER = "Python Software Foundation"
@@ -106,6 +108,11 @@ def compile_catalogs(locale: str) -> None:
106108
subprocess.run(cmd, cwd=PROJECT_DIR, check=True)
107109

108110

111+
class CustomBuildHook(BuildHookInterface):
112+
def initialize(self, version: str, build_data: dict[str, object]) -> None:
113+
compile_catalogs("")
114+
115+
109116
def main() -> None:
110117
parser = argparse.ArgumentParser(description=__doc__)
111118
parser.add_argument(

‎pyproject.toml‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
[build-system]
2-
build-backend = "flit_core.buildapi"
2+
build-backend = "hatchling.build"
33
requires = [
4-
"flit-core>=3.7",
4+
"babel",
5+
"hatchling",
56
]
67

78
[project]
89
name = "python-docs-theme"
910
description = "The Sphinx theme for the CPython docs and related projects"
1011
readme = "README.md"
1112
license = "PSF-2.0"
12-
license-files = [ "LICENSE" ]
13+
license-files = [ "LICENSE", "python_docs_theme/static/fonts/OFL.txt" ]
1314
authors = [ { name = "Python Docs Sphinx Theme maintainers" } ]
1415
requires-python = ">=3.12"
1516
classifiers = [
@@ -37,9 +38,15 @@ urls.Download = "https://pypi.org/project/python-docs-theme/"
3738
urls.Homepage = "https://github.com/python/python-docs-theme/"
3839
entry-points."sphinx.html_themes".python_docs_theme = "python_docs_theme"
3940

40-
[tool.flit]
41-
module.name = "python_docs_theme"
42-
sdist.include = [ "python_docs_theme/" ]
41+
[tool.hatch]
42+
version.path = "python_docs_theme/__init__.py"
43+
build.artifacts = [ "python_docs_theme/locale/**/*.mo" ]
44+
build.hooks.custom.path = "babel_runner.py"
45+
build.targets.wheel.packages = [ "python_docs_theme" ]
46+
build.targets.wheel.exclude = [
47+
"python_docs_theme/locale/**/*.po",
48+
"python_docs_theme/static/fonts/OFL.txt",
49+
]
4350

4451
[tool.ruff]
4552
fix = true

0 commit comments

Comments
 (0)