Skip to content

Commit 654decc

Browse files
authored
Merge branch 'master' into typing-ext-overload
2 parents 0ccb5b7 + 5e07baf commit 654decc

File tree

13 files changed

+51
-99
lines changed

13 files changed

+51
-99
lines changed

.github/workflows/builddoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install graphviz
3232
run: sudo apt-get install --no-install-recommends --yes graphviz
3333
- name: Install uv
34-
uses: astral-sh/setup-uv@v5
34+
uses: astral-sh/setup-uv@v6
3535
with:
3636
version: latest
3737
enable-cache: false

.github/workflows/create-release.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
python-version: "3"
3737
- name: Install uv
38-
uses: astral-sh/setup-uv@v5
38+
uses: astral-sh/setup-uv@v6
3939
with:
4040
version: latest
4141
enable-cache: false
@@ -47,8 +47,7 @@ jobs:
4747
run: python -m build
4848

4949
- name: Check distribution
50-
run: |
51-
twine check dist/*
50+
run: twine check dist/*
5251

5352
- name: Create Sigstore attestations for built distributions
5453
uses: actions/attest@v1
@@ -87,39 +86,10 @@ jobs:
8786
name: attestation-bundles
8887
path: /tmp/attestation-bundles/
8988

90-
- name: Mint PyPI API token
91-
id: mint-token
92-
uses: actions/github-script@v7
93-
with:
94-
# language=JavaScript
95-
script: |
96-
// retrieve the ambient OIDC token
97-
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
98-
const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
99-
const oidc_resp = await fetch(`${oidc_request_url}&audience=pypi`, {
100-
headers: {Authorization: `bearer ${oidc_request_token}`},
101-
});
102-
const oidc_token = (await oidc_resp.json()).value;
103-
104-
// exchange the OIDC token for an API token
105-
const mint_resp = await fetch('https://pypi.org/_/oidc/github/mint-token', {
106-
method: 'post',
107-
body: `{"token": "${oidc_token}"}` ,
108-
headers: {'Content-Type': 'application/json'},
109-
});
110-
const api_token = (await mint_resp.json()).token;
111-
112-
// mask the newly minted API token, so that we don't accidentally leak it
113-
core.setSecret(api_token)
114-
core.setOutput('api-token', api_token)
115-
11689
- name: Upload to PyPI
11790
env:
11891
TWINE_NON_INTERACTIVE: "true"
119-
TWINE_USERNAME: "__token__"
120-
TWINE_PASSWORD: "${{ steps.mint-token.outputs.api-token }}"
121-
run: |
122-
twine upload dist/* --attestations
92+
run: twine upload dist/* --attestations
12393

12494
github-release:
12595
runs-on: ubuntu-latest

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
with:
5151
python-version: "3"
5252
- name: Install uv
53-
uses: astral-sh/setup-uv@v5
53+
uses: astral-sh/setup-uv@v6
5454
with:
5555
version: latest
5656
enable-cache: false
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
python-version: "3"
7373
- name: Install uv
74-
uses: astral-sh/setup-uv@v5
74+
uses: astral-sh/setup-uv@v6
7575
with:
7676
version: latest
7777
enable-cache: false
@@ -92,7 +92,7 @@ jobs:
9292
with:
9393
python-version: "3"
9494
- name: Install uv
95-
uses: astral-sh/setup-uv@v5
95+
uses: astral-sh/setup-uv@v6
9696
with:
9797
version: latest
9898
enable-cache: false
@@ -113,7 +113,7 @@ jobs:
113113
with:
114114
python-version: "3"
115115
- name: Install uv
116-
uses: astral-sh/setup-uv@v5
116+
uses: astral-sh/setup-uv@v6
117117
with:
118118
version: latest
119119
enable-cache: false

.github/workflows/main.yml

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- "3.11"
3838
- "3.12"
3939
- "3.13"
40+
- "3.13t"
4041
docutils:
4142
- "0.20"
4243
- "0.21"
@@ -62,14 +63,18 @@ jobs:
6263
- name: Install graphviz
6364
run: sudo apt-get install --no-install-recommends --yes graphviz
6465
- name: Install uv
65-
uses: astral-sh/setup-uv@v5
66+
uses: astral-sh/setup-uv@v6
6667
with:
6768
version: latest
6869
enable-cache: false
6970
- name: Install dependencies
7071
run: uv pip install . --group test
72+
env:
73+
UV_PYTHON: "python${{ matrix.python }}"
7174
- name: Install Docutils ${{ matrix.docutils }}
7275
run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
76+
env:
77+
UV_PYTHON: "python${{ matrix.python }}"
7378
- name: Test with pytest
7479
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
7580
env:
@@ -103,46 +108,14 @@ jobs:
103108
- name: Install dependencies
104109
run: |
105110
python -m pip install --upgrade pip
106-
python -m pip install .[test]
111+
python -m pip install . --group test
107112
- name: Install Docutils ${{ matrix.docutils }}
108113
run: python -m pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
109114
- name: Test with pytest
110115
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
111116
env:
112117
PYTHONWARNINGS: "error" # treat all warnings as errors
113118

114-
free-threaded:
115-
runs-on: ubuntu-latest
116-
name: Python ${{ matrix.python }} (free-threaded)
117-
timeout-minutes: 15
118-
strategy:
119-
fail-fast: false
120-
matrix:
121-
python:
122-
- "3.13"
123-
124-
steps:
125-
- uses: actions/checkout@v4
126-
with:
127-
persist-credentials: false
128-
- name: Set up Python ${{ matrix.python }} (deadsnakes)
129-
uses: deadsnakes/[email protected]
130-
with:
131-
python-version: ${{ matrix.python }}
132-
nogil: true
133-
- name: Check Python version
134-
run: python --version --version
135-
- name: Install graphviz
136-
run: sudo apt-get install --no-install-recommends --yes graphviz
137-
- name: Install dependencies
138-
run: |
139-
python -m pip install --upgrade pip
140-
python -m pip install .[test]
141-
- name: Test with pytest
142-
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
143-
env:
144-
PYTHONWARNINGS: "error" # treat all warnings as errors
145-
146119
deadsnakes-free-threaded:
147120
runs-on: ubuntu-latest
148121
name: Python ${{ matrix.python }} (free-threaded)
@@ -169,7 +142,7 @@ jobs:
169142
- name: Install dependencies
170143
run: |
171144
python -m pip install --upgrade pip
172-
python -m pip install .[test]
145+
python -m pip install . --group test
173146
- name: Test with pytest
174147
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
175148
env:
@@ -181,6 +154,14 @@ jobs:
181154
timeout-minutes: 15
182155

183156
steps:
157+
# https://github.com/actions/runner-images/issues/8755
158+
# On standard runners, the D: drive is much faster.
159+
- name: Set %TMP% and %TEMP% to D:\\Temp
160+
run: |
161+
mkdir "D:\\Tmp"
162+
echo "TMP=D:\\Tmp" >> $env:GITHUB_ENV
163+
echo "TEMP=D:\\Tmp" >> $env:GITHUB_ENV
164+
184165
- uses: actions/checkout@v4
185166
with:
186167
persist-credentials: false
@@ -193,7 +174,7 @@ jobs:
193174
- name: Install graphviz
194175
run: choco install --no-progress graphviz
195176
- name: Install uv
196-
uses: astral-sh/setup-uv@v5
177+
uses: astral-sh/setup-uv@v6
197178
with:
198179
version: latest
199180
enable-cache: false
@@ -222,7 +203,7 @@ jobs:
222203
- name: Install graphviz
223204
run: brew install graphviz
224205
- name: Install uv
225-
uses: astral-sh/setup-uv@v5
206+
uses: astral-sh/setup-uv@v6
226207
with:
227208
version: latest
228209
enable-cache: false
@@ -257,7 +238,7 @@ jobs:
257238
- name: Install graphviz
258239
run: sudo apt-get install --no-install-recommends --yes graphviz
259240
- name: Install uv
260-
uses: astral-sh/setup-uv@v5
241+
uses: astral-sh/setup-uv@v6
261242
with:
262243
version: latest
263244
enable-cache: false
@@ -290,7 +271,7 @@ jobs:
290271
- name: Install graphviz
291272
run: sudo apt-get install --no-install-recommends --yes graphviz
292273
- name: Install uv
293-
uses: astral-sh/setup-uv@v5
274+
uses: astral-sh/setup-uv@v6
294275
with:
295276
version: latest
296277
enable-cache: false
@@ -321,7 +302,7 @@ jobs:
321302
- name: Check Python version
322303
run: python --version --version
323304
- name: Install uv
324-
uses: astral-sh/setup-uv@v5
305+
uses: astral-sh/setup-uv@v6
325306
with:
326307
version: latest
327308
enable-cache: false
@@ -352,7 +333,7 @@ jobs:
352333
- name: Install graphviz
353334
run: sudo apt-get install --no-install-recommends --yes graphviz
354335
- name: Install uv
355-
uses: astral-sh/setup-uv@v5
336+
uses: astral-sh/setup-uv@v6
356337
with:
357338
version: latest
358339
enable-cache: false

.github/workflows/transifex.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
3737
shell: bash
3838
- name: Install uv
39-
uses: astral-sh/setup-uv@v5
39+
uses: astral-sh/setup-uv@v6
4040
with:
4141
version: latest
4242
enable-cache: false
@@ -72,7 +72,7 @@ jobs:
7272
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
7373
shell: bash
7474
- name: Install uv
75-
uses: astral-sh/setup-uv@v5
75+
uses: astral-sh/setup-uv@v6
7676
with:
7777
version: latest
7878
enable-cache: false

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ docs = [
9292
"sphinxcontrib-websupport",
9393
]
9494
lint = [
95-
"ruff==0.11.2",
95+
"ruff==0.11.7",
9696
"mypy==1.15.0",
9797
"sphinx-lint>=0.9",
9898
"types-colorama==0.4.15.20240311",
@@ -102,9 +102,9 @@ lint = [
102102
"types-Pygments==2.19.0.20250305",
103103
"types-requests==2.32.0.20250328", # align with requests
104104
"types-urllib3==1.26.25.14",
105-
"pyright==1.1.397",
105+
"pyright==1.1.400",
106106
"pytest>=8.0",
107-
"pypi-attestations==0.0.22",
107+
"pypi-attestations==0.0.25",
108108
"betterproto==2.0.0b6",
109109
]
110110
test = [
@@ -135,14 +135,14 @@ docs = [
135135
"sphinxcontrib-websupport",
136136
]
137137
lint = [
138-
"ruff==0.11.2",
138+
"ruff==0.11.7",
139139
"sphinx-lint>=0.9",
140140
]
141141
package = [
142142
"betterproto==2.0.0b6", # resolution fails without betterproto
143143
"build",
144-
"pypi-attestations==0.0.22",
145-
"twine>=5.1",
144+
"pypi-attestations==0.0.25",
145+
"twine>=6.1",
146146
]
147147
test = [
148148
"pytest>=8.0",
@@ -158,7 +158,7 @@ translations = [
158158
]
159159
types = [
160160
"mypy==1.15.0",
161-
"pyright==1.1.397",
161+
"pyright==1.1.400",
162162
{ include-group = "type-stubs" },
163163
]
164164
type-stubs = [

sphinx/ext/autosummary/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def generate_autosummary_docs(
583583

584584
showed_sources = sorted(sources)
585585
if len(showed_sources) > 20:
586-
showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:]
586+
showed_sources = [*showed_sources[:10], '...', *showed_sources[-10:]]
587587
logger.info(
588588
__('[autosummary] generating autosummary for: %s'), ', '.join(showed_sources)
589589
)

sphinx/ext/napoleon/docstring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def _consume_returns_section(
535535

536536
if colon:
537537
if after:
538-
_desc = [after] + lines[1:]
538+
_desc = [after, *lines[1:]]
539539
else:
540540
_desc = lines[1:]
541541

@@ -684,7 +684,7 @@ def _format_field(self, _name: str, _type: str, _desc: list[str]) -> list[str]:
684684
if has_desc:
685685
_desc = self._fix_field_desc(_desc)
686686
if _desc[0]:
687-
return [field + _desc[0]] + _desc[1:]
687+
return [field + _desc[0], *_desc[1:]]
688688
else:
689689
return [field, *_desc]
690690
else:

sphinx/pycode/parser.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def get_qualname_for(self, name: str) -> list[str] | None:
257257
if self.current_function:
258258
if self.current_classes and self.context[-1] == '__init__':
259259
# store variable comments inside __init__ method of classes
260-
return self.context[:-1] + [name]
260+
return [*self.context[:-1], name]
261261
else:
262262
return None
263263
else:
@@ -384,9 +384,10 @@ def visit_Assign(self, node: ast.Assign) -> None:
384384
self.add_variable_annotation(varname, node.type_comment) # type: ignore[arg-type]
385385

386386
# check comments after assignment
387-
parser = AfterCommentParser(
388-
[current_line[node.col_offset :]] + self.buffers[node.lineno :]
389-
)
387+
parser = AfterCommentParser([
388+
current_line[node.col_offset :],
389+
*self.buffers[node.lineno :],
390+
])
390391
parser.parse()
391392
if parser.comment and comment_re.match(parser.comment):
392393
for varname in varnames:

sphinx/transforms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class SortIds(SphinxTransform):
217217
def apply(self, **kwargs: Any) -> None:
218218
for node in self.document.findall(nodes.section):
219219
if len(node['ids']) > 1 and node['ids'][0].startswith('id'):
220-
node['ids'] = node['ids'][1:] + [node['ids'][0]]
220+
node['ids'] = [*node['ids'][1:], node['ids'][0]]
221221

222222

223223
TRANSLATABLE_NODES = {

tests/roots/test-ext-autodoc/target/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ruff: NoQA: D403, PIE796
1+
# ruff: NoQA: PIE796
22
import enum
33
from typing import final
44

tests/test_builders/test_build_latex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_build_latex_doc(app, engine, docclass, python_maximum_signature_line_le
143143
}
144144
intersphinx_setup(app)
145145
app.config.latex_engine = engine
146-
app.config.latex_documents = [app.config.latex_documents[0][:4] + (docclass,)]
146+
app.config.latex_documents = [(*app.config.latex_documents[0][:4], docclass)]
147147
if engine == 'xelatex':
148148
app.config.latex_table_style = ['booktabs']
149149
elif engine == 'lualatex':

0 commit comments

Comments
 (0)