Skip to content

Commit 6805d44

Browse files
authored
Merge branch 'master' into latex_xelatex_math
2 parents b7983ae + 334e69f commit 6805d44

File tree

115 files changed

+2163
-793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2163
-793
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ exclude =
3333
doc/usage/extensions/example*.py,
3434
per-file-ignores =
3535
doc/conf.py:W605
36+
sphinx/events.py:E704,
3637
tests/test_extensions/ext_napoleon_pep526_data_google.py:MLL001,
3738
tests/test_extensions/ext_napoleon_pep526_data_numpy.py:MLL001,

.github/workflows/builddoc.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
env:
1616
FORCE_COLOR: "1"
17+
UV_SYSTEM_PYTHON: "1" # make uv do global installs
1718

1819
jobs:
1920
build:
@@ -27,10 +28,14 @@ jobs:
2728
python-version: "3"
2829
- name: Install graphviz
2930
run: sudo apt-get install graphviz
31+
- name: Install uv
32+
run: >
33+
curl --no-progress-meter --location --fail
34+
--proto '=https' --tlsv1.2
35+
"https://astral.sh/uv/install.sh"
36+
| sh
3037
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
python -m pip install .[docs]
38+
run: uv pip install .[docs]
3439
- name: Render the documentation
3540
run: >
3641
sphinx-build
@@ -39,4 +44,3 @@ jobs:
3944
--jobs=auto
4045
--show-traceback
4146
--fail-on-warning
42-
--keep-going

.github/workflows/lint.yml

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
env:
1616
FORCE_COLOR: "1"
17+
UV_SYSTEM_PYTHON: "1" # make uv do global installs
1718

1819
jobs:
1920
# If you update any of these commands, don't forget to update the equivalent
@@ -23,17 +24,18 @@ jobs:
2324

2425
steps:
2526
- uses: actions/checkout@v4
26-
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: "3"
30-
- name: Install pip
31-
run: python -m pip install --upgrade pip
27+
- name: Get Ruff version from pyproject.toml
28+
run: |
29+
RUFF_VERSION=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
30+
echo "RUFF_VERSION=$RUFF_VERSION" >> $GITHUB_ENV
3231
3332
- name: Install Ruff
34-
run: |
35-
ruff_version=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
36-
python -m pip install "ruff==${ruff_version}"
33+
run: >
34+
curl --no-progress-meter --location --fail
35+
--proto '=https' --tlsv1.2
36+
--write-out "%{stderr}Downloaded: %{url}\n"
37+
"https://astral.sh/ruff/$RUFF_VERSION/install.sh"
38+
| sh
3739
3840
- name: Lint with Ruff
3941
run: ruff check . --output-format github
@@ -50,10 +52,14 @@ jobs:
5052
uses: actions/setup-python@v5
5153
with:
5254
python-version: "3"
55+
- name: Install uv
56+
run: >
57+
curl --no-progress-meter --location --fail
58+
--proto '=https' --tlsv1.2
59+
"https://astral.sh/uv/install.sh"
60+
| sh
5361
- name: Install dependencies
54-
run: |
55-
python -m pip install --upgrade pip
56-
python -m pip install --upgrade "flake8>=6.0"
62+
run: uv pip install --upgrade "flake8>=6.0"
5763
- name: Lint with flake8
5864
run: flake8 .
5965

@@ -66,10 +72,14 @@ jobs:
6672
uses: actions/setup-python@v5
6773
with:
6874
python-version: "3"
75+
- name: Install uv
76+
run: >
77+
curl --no-progress-meter --location --fail
78+
--proto '=https' --tlsv1.2
79+
"https://astral.sh/uv/install.sh"
80+
| sh
6981
- name: Install dependencies
70-
run: |
71-
python -m pip install --upgrade pip
72-
python -m pip install ".[lint,test]"
82+
run: uv pip install ".[lint,test]"
7383
- name: Type check with mypy
7484
run: mypy
7585

@@ -82,10 +92,14 @@ jobs:
8292
uses: actions/setup-python@v5
8393
with:
8494
python-version: "3"
95+
- name: Install uv
96+
run: >
97+
curl --no-progress-meter --location --fail
98+
--proto '=https' --tlsv1.2
99+
"https://astral.sh/uv/install.sh"
100+
| sh
85101
- name: Install dependencies
86-
run: |
87-
python -m pip install --upgrade pip
88-
python -m pip install --upgrade sphinx-lint
102+
run: uv pip install --upgrade sphinx-lint
89103
- name: Lint documentation with sphinx-lint
90104
run: make doclinter
91105

@@ -98,10 +112,14 @@ jobs:
98112
uses: actions/setup-python@v5
99113
with:
100114
python-version: "3"
115+
- name: Install uv
116+
run: >
117+
curl --no-progress-meter --location --fail
118+
--proto '=https' --tlsv1.2
119+
"https://astral.sh/uv/install.sh"
120+
| sh
101121
- name: Install dependencies
102-
run: |
103-
python -m pip install --upgrade pip
104-
python -m pip install --upgrade twine build
122+
run: uv pip install --upgrade twine build
105123
- name: Lint with twine
106124
run: |
107125
python -m build .

.github/workflows/main.yml

Lines changed: 69 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
- "3.10"
3737
- "3.11"
3838
- "3.12"
39-
- "3.13-dev"
4039
docutils:
4140
- "0.20"
4241
- "0.21"
@@ -49,12 +48,43 @@ jobs:
4948
- uses: actions/checkout@v4
5049
- name: Set up Python ${{ matrix.python }}
5150
uses: actions/setup-python@v5
52-
if: "!endsWith(matrix.python, '-dev')"
5351
with:
5452
python-version: ${{ matrix.python }}
53+
- name: Check Python version
54+
run: python --version --version
55+
- name: Install graphviz
56+
run: sudo apt-get install graphviz
57+
- name: Install uv
58+
run: >
59+
curl --no-progress-meter --location --fail
60+
--proto '=https' --tlsv1.2
61+
"https://astral.sh/uv/install.sh"
62+
| sh
63+
- name: Install dependencies
64+
run: uv pip install .[test]
65+
- name: Install Docutils ${{ matrix.docutils }}
66+
run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
67+
- name: Test with pytest
68+
run: python -m pytest -vv --durations 25
69+
env:
70+
PYTHONWARNINGS: "error" # treat all warnings as errors
71+
72+
deadsnakes:
73+
runs-on: ubuntu-latest
74+
name: Python ${{ matrix.python }} (Docutils ${{ matrix.docutils }})
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
python:
79+
- "3.13-dev"
80+
docutils:
81+
- "0.20"
82+
- "0.21"
83+
84+
steps:
85+
- uses: actions/checkout@v4
5586
- name: Set up Python ${{ matrix.python }} (deadsnakes)
5687
uses: deadsnakes/action@v3.1.0
57-
if: "endsWith(matrix.python, '-dev')"
5888
with:
5989
python-version: ${{ matrix.python }}
6090
- name: Check Python version
@@ -84,10 +114,14 @@ jobs:
84114
python-version: "3"
85115
- name: Check Python version
86116
run: python --version --version
117+
- name: Install graphviz
118+
run: choco install --no-progress graphviz
119+
- name: Install uv
120+
run: >
121+
Invoke-WebRequest -Uri "https://astral.sh/uv/install.ps1"
122+
| Invoke-Expression
87123
- name: Install dependencies
88-
run: |
89-
python -m pip install --upgrade pip
90-
python -m pip install .[test]
124+
run: uv pip install .[test]
91125
- name: Test with pytest
92126
run: python -m pytest -vv --durations 25
93127
env:
@@ -100,9 +134,10 @@ jobs:
100134
steps:
101135
- name: Install epubcheck
102136
run: |
137+
EPUBCHECK_VERSION="5.1.0"
103138
mkdir /tmp/epubcheck && cd /tmp/epubcheck
104-
wget https://github.com/w3c/epubcheck/releases/download/v5.1.0/epubcheck-5.1.0.zip
105-
unzip epubcheck-5.1.0.zip
139+
wget --no-verbose https://github.com/w3c/epubcheck/releases/download/v${EPUBCHECK_VERSION}/epubcheck-${EPUBCHECK_VERSION}.zip
140+
unzip epubcheck-${EPUBCHECK_VERSION}.zip
106141
- uses: actions/checkout@v4
107142
- name: Set up Python
108143
uses: actions/setup-python@v5
@@ -112,12 +147,16 @@ jobs:
112147
run: python --version --version
113148
- name: Install graphviz
114149
run: sudo apt-get install graphviz
150+
- name: Install uv
151+
run: >
152+
curl --no-progress-meter --location --fail
153+
--proto '=https' --tlsv1.2
154+
"https://astral.sh/uv/install.sh"
155+
| sh
115156
- name: Install dependencies
116-
run: |
117-
python -m pip install --upgrade pip
118-
python -m pip install .[test]
157+
run: uv pip install .[test]
119158
- name: Install Docutils' HEAD
120-
run: python -m pip install git+https://repo.or.cz/docutils.git\#subdirectory=docutils
159+
run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils"
121160
- name: Test with pytest
122161
run: python -m pytest -vv
123162
env:
@@ -140,13 +179,10 @@ jobs:
140179
- name: Install graphviz
141180
run: sudo apt-get install graphviz
142181
- name: Install uv
143-
run: >
144-
curl
145-
--location
146-
--fail
147-
--proto '=https' --tlsv1.2
148-
--silent --show-error
149-
https://astral.sh/uv/install.sh
182+
run: >
183+
curl --no-progress-meter --location --fail
184+
--proto '=https' --tlsv1.2
185+
"https://astral.sh/uv/install.sh"
150186
| sh
151187
- name: Install dependencies
152188
run: |
@@ -171,10 +207,14 @@ jobs:
171207
python-version: "3"
172208
- name: Check Python version
173209
run: python --version --version
210+
- name: Install uv
211+
run: >
212+
curl --no-progress-meter --location --fail
213+
--proto '=https' --tlsv1.2
214+
"https://astral.sh/uv/install.sh"
215+
| sh
174216
- name: Install dependencies
175-
run: |
176-
python -m pip install --upgrade pip
177-
python -m pip install .[test]
217+
run: uv pip install .[test]
178218
- name: Test with pytest
179219
run: python -m pytest -vv --durations 25
180220
env:
@@ -196,10 +236,14 @@ jobs:
196236
run: python --version --version
197237
- name: Install graphviz
198238
run: sudo apt-get install graphviz
239+
- name: Install uv
240+
run: >
241+
curl --no-progress-meter --location --fail
242+
--proto '=https' --tlsv1.2
243+
"https://astral.sh/uv/install.sh"
244+
| sh
199245
- name: Install dependencies
200-
run: |
201-
python -m pip install --upgrade pip
202-
python -m pip install .[test] pytest-cov
246+
run: uv pip install .[test] pytest-cov
203247
- name: Test with pytest
204248
run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml
205249
env:

.github/workflows/nodejs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2424
cancel-in-progress: true
2525

26+
env:
27+
FORCE_COLOR: "1"
28+
2629
jobs:
2730
build:
2831
runs-on: ubuntu-latest
2932
env:
30-
node-version: "16"
33+
node-version: "20"
3134

3235
steps:
3336
- uses: actions/checkout@v4
@@ -37,5 +40,4 @@ jobs:
3740
node-version: ${{ env.node-version }}
3841
cache: "npm"
3942
- run: npm install
40-
- name: Run headless test
41-
run: xvfb-run -a npm test
43+
- run: npm test

CHANGES.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ Features added
4343
output files.
4444
* #12474: Support type-dependent search result highlighting via CSS.
4545
Patch by Tim Hoffmann.
46+
* #12743: No longer exit on the first warning when
47+
:option:`--fail-on-warning <sphinx-build --fail-on-warning>` is used.
48+
Instead, exit with a non-zero status if any warnings were generated
49+
during the build.
50+
Patch by Adam Turner.
51+
* #12743: Add :option:`sphinx-build --exception-on-warning`,
52+
to raise an exception when warnings are emitted during the build.
53+
Patch by Adam Turner and Jeremy Maitin-Shepard.
4654

4755
Bugs fixed
4856
----------
@@ -70,6 +78,11 @@ Bugs fixed
7078
get passed to :program:`latexmk`. Let :option:`-Q <sphinx-build -Q>`
7179
(silent) apply as well to the PDF build phase.
7280
Patch by Jean-François B.
81+
* #11970, #12551: singlehtml builder: make target URIs to be same-document
82+
references in the sense of :rfc:`RFC 3986, §4.4 <3986#section-4.4>`,
83+
e.g., ``index.html#foo`` becomes ``#foo``.
84+
(note: continuation of a partial fix added in Sphinx 7.3.0)
85+
Patch by James Addison (with reference to prior work by Eric Norige)
7386

7487
Testing
7588
-------

doc/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,24 @@
186186
('js:func', 'number'),
187187
('js:func', 'string'),
188188
('py:attr', 'srcline'),
189+
('py:class', '_ConfigRebuild'), # sphinx.application.Sphinx.add_config_value
189190
('py:class', '_StrPath'), # sphinx.environment.BuildEnvironment.doc2path
190191
('py:class', 'Element'), # sphinx.domains.Domain
191192
('py:class', 'Documenter'), # sphinx.application.Sphinx.add_autodocumenter
192193
('py:class', 'IndexEntry'), # sphinx.domains.IndexEntry
194+
('py:class', 'Lexer'), # sphinx.application.Sphinx.add_lexer
193195
('py:class', 'Node'), # sphinx.domains.Domain
194196
('py:class', 'NullTranslations'), # gettext.NullTranslations
197+
('py:class', 'Path'), # sphinx.application.Sphinx.connect
195198
('py:class', 'RoleFunction'), # sphinx.domains.Domain
196199
('py:class', 'RSTState'), # sphinx.utils.parsing.nested_parse_to_nodes
197200
('py:class', 'Theme'), # sphinx.application.TemplateBridge
198201
('py:class', 'SearchLanguage'), # sphinx.application.Sphinx.add_search_language
199202
('py:class', 'StringList'), # sphinx.utils.parsing.nested_parse_to_nodes
200203
('py:class', 'system_message'), # sphinx.utils.docutils.SphinxDirective
201204
('py:class', 'TitleGetter'), # sphinx.domains.Domain
205+
('py:class', 'todo_node'), # sphinx.application.Sphinx.connect
206+
('py:class', 'Transform'), # sphinx.application.Sphinx.add_transform
202207
('py:class', 'XRefRole'), # sphinx.domains.Domain
203208
('py:class', 'docutils.nodes.Element'),
204209
('py:class', 'docutils.nodes.Node'),
@@ -210,6 +215,7 @@
210215
('py:class', 'docutils.parsers.rst.states.Inliner'),
211216
('py:class', 'docutils.transforms.Transform'),
212217
('py:class', 'nodes.NodeVisitor'),
218+
('py:class', 'nodes.TextElement'), # sphinx.application.Sphinx.connect
213219
('py:class', 'nodes.document'),
214220
('py:class', 'nodes.reference'),
215221
('py:class', 'pygments.lexer.Lexer'),

0 commit comments

Comments
 (0)