Skip to content

Commit 09dffc0

Browse files
authored
Merge branch 'master' into master
2 parents 8f8b0ac + b6b01c2 commit 09dffc0

File tree

155 files changed

+492
-112
lines changed

Some content is hidden

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

155 files changed

+492
-112
lines changed

.github/workflows/builddoc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
2527
- name: Set up Python
2628
uses: actions/setup-python@v5
2729
with:

.github/workflows/create-release.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
id-token: write # for PyPI trusted publishing
2929
steps:
3030
- uses: actions/checkout@v4
31+
with:
32+
persist-credentials: false
3133
- name: Set up Python
3234
uses: actions/setup-python@v5
3335
with:
@@ -62,11 +64,15 @@ jobs:
6264
show-summary: "true"
6365

6466
- name: Convert attestations to PEP 740
65-
# workflow_ref example: sphinx-doc/sphinx/.github/workflows/create-release.yml@refs/heads/master
6667
run: >
6768
python utils/convert_attestations.py
68-
"${{ steps.attest.outputs.bundle-path }}"
69-
"https://github.com/${{ github.workflow_ref }}"
69+
"$BUNDLE_PATH"
70+
"$SIGNER_IDENTITY"
71+
env:
72+
BUNDLE_PATH: "${{ steps.attest.outputs.bundle-path }}"
73+
# workflow_ref example: sphinx-doc/sphinx/.github/workflows/create-release.yml@refs/heads/master
74+
# this forms the "signer identity" for the attestations
75+
SIGNER_IDENTITY: "https://github.com/${{ github.workflow_ref }}"
7076

7177
- name: Inspect PEP 740 attestations
7278
run: |
@@ -75,8 +81,10 @@ jobs:
7581
- name: Prepare attestation bundles for uploading
7682
run: |
7783
mkdir -p /tmp/attestation-bundles
78-
cp "${{ steps.attest.outputs.bundle-path }}" /tmp/attestation-bundles/
84+
cp "$BUNDLE_PATH" /tmp/attestation-bundles/
7985
cp dist/*.publish.attestation /tmp/attestation-bundles/
86+
env:
87+
BUNDLE_PATH: "${{ steps.attest.outputs.bundle-path }}"
8088

8189
- name: Upload attestation bundles
8290
uses: actions/upload-artifact@v4
@@ -97,7 +105,7 @@ jobs:
97105
headers: {Authorization: `bearer ${oidc_request_token}`},
98106
});
99107
const oidc_token = (await oidc_resp.json()).value;
100-
108+
101109
// exchange the OIDC token for an API token
102110
const mint_resp = await fetch('https://pypi.org/_/oidc/github/mint-token', {
103111
method: 'post',
@@ -127,6 +135,8 @@ jobs:
127135
contents: write # for softprops/action-gh-release to create GitHub release
128136
steps:
129137
- uses: actions/checkout@v4
138+
with:
139+
persist-credentials: false
130140
- name: Get release version
131141
id: get_version
132142
uses: actions/github-script@v7

.github/workflows/lint.yml

+12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
2729
- name: Get Ruff version from pyproject.toml
2830
run: |
2931
RUFF_VERSION=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
@@ -48,6 +50,8 @@ jobs:
4850

4951
steps:
5052
- uses: actions/checkout@v4
53+
with:
54+
persist-credentials: false
5155
- name: Set up Python
5256
uses: actions/setup-python@v5
5357
with:
@@ -68,6 +72,8 @@ jobs:
6872

6973
steps:
7074
- uses: actions/checkout@v4
75+
with:
76+
persist-credentials: false
7177
- name: Set up Python
7278
uses: actions/setup-python@v5
7379
with:
@@ -88,6 +94,8 @@ jobs:
8894

8995
steps:
9096
- uses: actions/checkout@v4
97+
with:
98+
persist-credentials: false
9199
- name: Set up Python
92100
uses: actions/setup-python@v5
93101
with:
@@ -108,6 +116,8 @@ jobs:
108116

109117
steps:
110118
- uses: actions/checkout@v4
119+
with:
120+
persist-credentials: false
111121
- name: Set up Python
112122
uses: actions/setup-python@v5
113123
with:
@@ -128,6 +138,8 @@ jobs:
128138

129139
steps:
130140
- uses: actions/checkout@v4
141+
with:
142+
persist-credentials: false
131143
- name: Set up Python
132144
uses: actions/setup-python@v5
133145
with:

.github/workflows/lock.yml

+48-10
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,57 @@ name: Lock old threads
22

33
on:
44
schedule:
5+
# Run at midnight daily
56
- cron: "0 0 * * *"
6-
7-
permissions:
8-
issues: write
9-
pull-requests: write
7+
workflow_dispatch:
108

119
jobs:
1210
action:
13-
if: github.repository_owner == 'sphinx-doc'
1411
runs-on: ubuntu-latest
12+
if: github.repository_owner == 'sphinx-doc'
13+
permissions:
14+
# to lock issues and PRs
15+
issues: write
16+
pull-requests: write
1517
steps:
16-
- uses: dessant/lock-threads@v3
17-
with:
18-
github-token: ${{ github.token }}
19-
issue-inactive-days: "30"
20-
pr-inactive-days: "30"
18+
- uses: actions/github-script@v7
19+
with:
20+
retries: 3
21+
# language=JavaScript
22+
script: |
23+
const _FOUR_WEEKS_MILLISECONDS = 28 * 24 * 60 * 60 * 1000;
24+
const _FOUR_WEEKS_DATE = new Date(Date.now() - _FOUR_WEEKS_MILLISECONDS);
25+
const FOUR_WEEKS_AGO = `${_FOUR_WEEKS_DATE.toISOString().substring(0, 10)}T00:00:00Z`;
26+
const OWNER = context.repo.owner;
27+
const REPO = context.repo.repo;
28+
29+
try {
30+
for (const thread_type of ["issue", "pr"]) {
31+
core.debug(`Finding ${thread_type}s to lock`);
32+
const query = thread_type === "issue"
33+
? `repo:${OWNER}/${REPO} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:issue`
34+
: `repo:${OWNER}/${REPO} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:pr`;
35+
core.debug(`Using query '${query}'`);
36+
// https://octokit.github.io/rest.js/v21/#search-issues-and-pull-requests
37+
const {data: {items: results}} = await github.rest.search.issuesAndPullRequests({
38+
q: query,
39+
order: "desc",
40+
sort: "updated",
41+
per_page: 100,
42+
});
43+
for (const item of results) {
44+
if (item.locked) continue;
45+
const thread_num = item.number;
46+
core.debug(`Locking #${thread_num} (${thread_type})`);
47+
// https://octokit.github.io/rest.js/v21/#issues-lock
48+
await github.rest.issues.lock({
49+
owner: OWNER,
50+
repo: REPO,
51+
issue_number: thread_num,
52+
lock_reason: "resolved",
53+
});
54+
}
55+
}
56+
} catch (err) {
57+
core.setFailed(err.message);
58+
}

.github/workflows/main.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747

4848
steps:
4949
- uses: actions/checkout@v4
50+
with:
51+
persist-credentials: false
5052
- name: Set up Python ${{ matrix.python }}
5153
uses: actions/setup-python@v5
5254
with:
@@ -85,6 +87,8 @@ jobs:
8587

8688
steps:
8789
- uses: actions/checkout@v4
90+
with:
91+
persist-credentials: false
8892
- name: Set up Python ${{ matrix.python }} (deadsnakes)
8993
uses: deadsnakes/[email protected]
9094
with:
@@ -117,6 +121,8 @@ jobs:
117121

118122
steps:
119123
- uses: actions/checkout@v4
124+
with:
125+
persist-credentials: false
120126
- name: Set up Python ${{ matrix.python }} (deadsnakes)
121127
uses: deadsnakes/[email protected]
122128
with:
@@ -150,6 +156,8 @@ jobs:
150156

151157
steps:
152158
- uses: actions/checkout@v4
159+
with:
160+
persist-credentials: false
153161
- name: Set up Python ${{ matrix.python }} (deadsnakes)
154162
uses: deadsnakes/[email protected]
155163
with:
@@ -179,6 +187,8 @@ jobs:
179187

180188
steps:
181189
- uses: actions/checkout@v4
190+
with:
191+
persist-credentials: false
182192
- name: Set up Python
183193
uses: actions/setup-python@v5
184194
with:
@@ -211,6 +221,8 @@ jobs:
211221
wget --no-verbose https://github.com/w3c/epubcheck/releases/download/v${EPUBCHECK_VERSION}/epubcheck-${EPUBCHECK_VERSION}.zip
212222
unzip epubcheck-${EPUBCHECK_VERSION}.zip
213223
- uses: actions/checkout@v4
224+
with:
225+
persist-credentials: false
214226
- name: Set up Python
215227
uses: actions/setup-python@v5
216228
with:
@@ -243,6 +255,8 @@ jobs:
243255

244256
steps:
245257
- uses: actions/checkout@v4
258+
with:
259+
persist-credentials: false
246260
- name: Set up Python
247261
uses: actions/setup-python@v5
248262
with:
@@ -275,6 +289,8 @@ jobs:
275289

276290
steps:
277291
- uses: actions/checkout@v4
292+
with:
293+
persist-credentials: false
278294
- name: Set up Python
279295
uses: actions/setup-python@v5
280296
with:
@@ -303,6 +319,8 @@ jobs:
303319

304320
steps:
305321
- uses: actions/checkout@v4
322+
with:
323+
persist-credentials: false
306324
- name: Set up Python
307325
uses: actions/setup-python@v5
308326
with:
@@ -324,4 +342,4 @@ jobs:
324342
env:
325343
VIRTUALENV_SYSTEM_SITE_PACKAGES: "1"
326344
- name: codecov
327-
uses: codecov/codecov-action@v4
345+
uses: codecov/codecov-action@v5

.github/workflows/nodejs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434

3535
steps:
3636
- uses: actions/checkout@v4
37+
with:
38+
persist-credentials: false
3739
- name: Use Node.js ${{ env.node-version }}
3840
uses: actions/setup-node@v4
3941
with:

.github/workflows/transifex.yml

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
1921
- name: Set up Python
2022
uses: actions/setup-python@v5
2123
with:
@@ -45,6 +47,8 @@ jobs:
4547

4648
steps:
4749
- uses: actions/checkout@v4
50+
with:
51+
persist-credentials: false
4852
- name: Set up Python
4953
uses: actions/setup-python@v5
5054
with:

.ruff.toml

+9-4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ ignore = [
5454
"PLR6301", # Method `{method_name}` could be a function, class method, or static method
5555
# pylint ('PLW')
5656
"PLW2901", # Outer {outer_kind} variable `{name}` overwritten by inner {inner_kind} target
57+
# flake8-pyi ('PYI')
58+
"PYI025", # Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin
5759
# flake8-bandit ('S')
5860
"S101", # Use of `assert` detected
5961
"S110", # `try`-`except`-`pass` detected, consider logging the exception
@@ -198,7 +200,7 @@ select = [
198200
"PT",
199201
# flake8-use-pathlib ('PTH')
200202
# NOT YET USED
201-
# flake8-pyi ('PYI')
203+
"PYI",
202204
# Stub files are not used in Sphinx
203205
# flake8-quotes ('Q')
204206
# "Q000", # Double quotes found but single quotes preferred
@@ -290,10 +292,10 @@ select = [
290292
[lint.per-file-ignores]
291293
"doc/*" = [
292294
"ANN", # documentation doesn't need annotations
293-
"TCH001", # documentation doesn't need type-checking blocks
295+
"TC001", # documentation doesn't need type-checking blocks
294296
]
295297
"doc/conf.py" = ["INP001", "W605"]
296-
"doc/development/tutorials/examples/*" = ["INP001"]
298+
"doc/development/tutorials/examples/*" = ["I002", "INP001"]
297299
# allow print() in the tutorial
298300
"doc/development/tutorials/examples/recipe.py" = [
299301
"FURB118",
@@ -358,7 +360,7 @@ select = [
358360

359361
# these tests need old ``typing`` generic aliases
360362
"tests/test_util/test_util_typing.py" = ["UP006", "UP007", "UP035"]
361-
"tests/test_util/typing_test_data.py" = ["FA100", "UP006", "UP007", "UP035"]
363+
"tests/test_util/typing_test_data.py" = ["FA100", "I002", "PYI030", "UP006", "UP007", "UP035"]
362364

363365
"utils/*" = [
364366
"T201", # whitelist ``print`` for stdout messages
@@ -375,6 +377,9 @@ inline-quotes = "single"
375377
forced-separate = [
376378
"tests",
377379
]
380+
required-imports = [
381+
"from __future__ import annotations",
382+
]
378383

379384
[format]
380385
preview = true

CHANGES.rst

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Bugs fixed
2323

2424
* #13060: HTML Search: use ``Map`` to store per-file term scores.
2525
Patch by James Addison
26+
* LaTeX: fix a ``7.4.0`` typo in a default for ``\sphinxboxsetup``
27+
(refs: PR #13152).
28+
Patch by Jean-François B.
2629

2730
Testing
2831
-------

doc/man/sphinx-build.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Options
141141
.. versionchanged:: 6.2
142142
Add ``--jobs`` long option.
143143

144-
.. option:: -c path, --config-dir path
144+
.. option:: -c path, --conf-dir path
145145

146146
Don't look for the :file:`conf.py` in the source directory, but use the given
147147
configuration directory instead. Note that various other files and paths
@@ -152,7 +152,7 @@ Options
152152
.. versionadded:: 0.3
153153

154154
.. versionchanged:: 7.3
155-
Add ``--config-dir`` long option.
155+
Add ``--conf-dir`` long option.
156156

157157
.. option:: -C, --isolated
158158

doc/tutorial/deploying.rst

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ contents:
188188
contents: write
189189
steps:
190190
- uses: actions/checkout@v4
191+
with:
192+
persist-credentials: false
191193
- name: Build HTML
192194
uses: ammaraskar/sphinx-action@master
193195
- name: Upload artifacts

0 commit comments

Comments
 (0)