Skip to content

Commit bdde260

Browse files
Merge branch 'master' into gh-14179-decorated-func-returns-value
2 parents fe52ee1 + db67888 commit bdde260

File tree

952 files changed

+51765
-18963
lines changed

Some content is hidden

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

952 files changed

+51765
-18963
lines changed

.github/workflows/build_wheels.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ on:
66
tags: ['*']
77

88
permissions:
9-
contents: write
9+
contents: read
1010

1111
jobs:
1212
build-wheels:
1313
if: github.repository == 'python/mypy'
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
1719
- uses: actions/setup-python@v5
1820
with:
1921
python-version: '3.11'

.github/workflows/docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ jobs:
3535
VERIFY_MYPY_ERROR_CODES: 1
3636
steps:
3737
- uses: actions/checkout@v4
38+
with:
39+
persist-credentials: false
3840
- uses: actions/setup-python@v5
3941
with:
4042
python-version: '3.12'
4143
- name: Install tox
42-
run: pip install tox==4.21.2
44+
run: pip install tox==4.26.0
4345
- name: Setup tox environment
4446
run: tox run -e ${{ env.TOXENV }} --notest
4547
- name: Test

.github/workflows/mypy_primer.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,20 @@ jobs:
2626
mypy_primer:
2727
name: Run mypy_primer
2828
runs-on: ubuntu-latest
29-
permissions:
30-
contents: read
3129
strategy:
3230
matrix:
33-
shard-index: [0, 1, 2, 3, 4]
31+
shard-index: [0, 1, 2, 3, 4, 5]
3432
fail-fast: false
3533
timeout-minutes: 60
3634
steps:
3735
- uses: actions/checkout@v4
3836
with:
3937
path: mypy_to_test
4038
fetch-depth: 0
39+
persist-credentials: false
4140
- uses: actions/setup-python@v5
4241
with:
43-
python-version: "3.12"
42+
python-version: "3.13"
4443
- name: Install dependencies
4544
run: |
4645
python -m pip install -U pip
@@ -64,7 +63,7 @@ jobs:
6463
mypy_primer \
6564
--repo mypy_to_test \
6665
--new $GITHUB_SHA --old base_commit \
67-
--num-shards 5 --shard-index ${{ matrix.shard-index }} \
66+
--num-shards 6 --shard-index ${{ matrix.shard-index }} \
6867
--debug \
6968
--additional-flags="--debug-serialize" \
7069
--output concise \
@@ -74,9 +73,9 @@ jobs:
7473
name: Save PR number
7574
run: |
7675
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
77-
- if: ${{ matrix.shard-index == 0 }}
78-
name: Upload mypy_primer diff + PR number
76+
- name: Upload mypy_primer diff + PR number
7977
uses: actions/upload-artifact@v4
78+
if: ${{ matrix.shard-index == 0 }}
8079
with:
8180
name: mypy_primer_diffs-${{ matrix.shard-index }}
8281
path: |
@@ -93,8 +92,6 @@ jobs:
9392
name: Join artifacts
9493
runs-on: ubuntu-latest
9594
needs: [mypy_primer]
96-
permissions:
97-
contents: read
9895
steps:
9996
- name: Merge artifacts
10097
uses: actions/upload-artifact/merge@v4

.github/workflows/mypy_primer_comment.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
name: Comment with mypy_primer diff
22

3-
on:
3+
on: # zizmor: ignore[dangerous-triggers]
44
workflow_run:
55
workflows:
66
- Run mypy_primer
77
types:
88
- completed
99

10-
permissions:
11-
contents: read
12-
pull-requests: write
10+
permissions: {}
1311

1412
jobs:
1513
comment:
1614
name: Comment PR from mypy_primer
1715
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
pull-requests: write
1819
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1920
steps:
2021
- name: Download diffs
@@ -48,7 +49,7 @@ jobs:
4849
with:
4950
github-token: ${{ secrets.GITHUB_TOKEN }}
5051
script: |
51-
const MAX_CHARACTERS = 30000
52+
const MAX_CHARACTERS = 50000
5253
const MAX_CHARACTERS_PER_PROJECT = MAX_CHARACTERS / 3
5354
5455
const fs = require('fs')

.github/workflows/sync_typeshed.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@ on:
55
schedule:
66
- cron: "0 0 1,15 * *"
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
8+
permissions: {}
119

1210
jobs:
1311
sync_typeshed:
1412
name: Sync typeshed
1513
if: github.repository == 'python/mypy'
1614
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: write
1718
timeout-minutes: 10
1819
steps:
1920
- uses: actions/checkout@v4
2021
with:
2122
fetch-depth: 0
23+
persist-credentials: true # needed to `git push` the PR branch
2224
# TODO: use whatever solution ends up working for
2325
# https://github.com/python/typeshed/issues/8434
2426
- uses: actions/setup-python@v5

.github/workflows/test.yml

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -31,65 +31,50 @@ jobs:
3131
include:
3232
# Make sure to run mypyc compiled unit tests for both
3333
# the oldest and newest supported Python versions
34-
- name: Test suite with py38-ubuntu, mypyc-compiled
35-
python: '3.8'
36-
arch: x64
37-
os: ubuntu-latest
34+
- name: Test suite with py39-ubuntu, mypyc-compiled
35+
python: '3.9'
36+
os: ubuntu-24.04-arm
3837
toxenv: py
3938
tox_extra_args: "-n 4"
4039
test_mypyc: true
41-
- name: Test suite with py38-windows-64
42-
python: '3.8'
43-
arch: x64
44-
os: windows-latest
45-
toxenv: py38
46-
tox_extra_args: "-n 4"
47-
- name: Test suite with py39-ubuntu
40+
- name: Test suite with py39-windows-64
4841
python: '3.9'
49-
arch: x64
50-
os: ubuntu-latest
51-
toxenv: py
42+
os: windows-latest
43+
toxenv: py39
5244
tox_extra_args: "-n 4"
5345
- name: Test suite with py310-ubuntu
5446
python: '3.10'
55-
arch: x64
56-
os: ubuntu-latest
47+
os: ubuntu-24.04-arm
5748
toxenv: py
5849
tox_extra_args: "-n 4"
59-
- name: Test suite with py311-ubuntu, mypyc-compiled
50+
- name: Test suite with py311-ubuntu
6051
python: '3.11'
61-
arch: x64
62-
os: ubuntu-latest
52+
os: ubuntu-24.04-arm
6353
toxenv: py
6454
tox_extra_args: "-n 4"
65-
test_mypyc: true
6655
- name: Test suite with py312-ubuntu, mypyc-compiled
6756
python: '3.12'
68-
arch: x64
69-
os: ubuntu-latest
57+
os: ubuntu-24.04-arm
7058
toxenv: py
7159
tox_extra_args: "-n 4"
7260
test_mypyc: true
7361
- name: Test suite with py313-ubuntu, mypyc-compiled
7462
python: '3.13'
75-
arch: x64
76-
os: ubuntu-latest
63+
os: ubuntu-24.04-arm
7764
toxenv: py
7865
tox_extra_args: "-n 4"
7966
test_mypyc: true
8067

81-
# - name: Test suite with py314-dev-ubuntu
82-
# python: '3.14-dev'
83-
# arch: x64
84-
# os: ubuntu-latest
85-
# toxenv: py
86-
# tox_extra_args: "-n 4"
87-
# allow_failure: true
88-
# test_mypyc: true
68+
- name: Test suite with py314-dev-ubuntu
69+
python: '3.14-dev'
70+
os: ubuntu-24.04-arm
71+
toxenv: py
72+
tox_extra_args: "-n 4"
73+
# allow_failure: true
74+
test_mypyc: true
8975

9076
- name: mypyc runtime tests with py39-macos
91-
python: '3.9.18'
92-
arch: x64
77+
python: '3.9.21'
9378
# TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
9479
os: macos-13
9580
toxenv: py
@@ -98,21 +83,18 @@ jobs:
9883
# - https://github.com/python/mypy/issues/17819
9984
# - https://github.com/python/mypy/pull/17822
10085
# - name: mypyc runtime tests with py38-debug-build-ubuntu
101-
# python: '3.8.17'
102-
# arch: x64
86+
# python: '3.9.21'
10387
# os: ubuntu-latest
10488
# toxenv: py
10589
# tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
10690
# debug_build: true
10791

108-
- name: Type check our own code (py38-ubuntu)
109-
python: '3.8'
110-
arch: x64
92+
- name: Type check our own code (py39-ubuntu)
93+
python: '3.9'
11194
os: ubuntu-latest
11295
toxenv: type
113-
- name: Type check our own code (py38-windows-64)
114-
python: '3.8'
115-
arch: x64
96+
- name: Type check our own code (py39-windows-64)
97+
python: '3.9'
11698
os: windows-latest
11799
toxenv: type
118100

@@ -121,7 +103,6 @@ jobs:
121103
# to ensure the tox env works as expected
122104
- name: Formatting and code style with Black + ruff
123105
python: '3.10'
124-
arch: x64
125106
os: ubuntu-latest
126107
toxenv: lint
127108

@@ -133,6 +114,8 @@ jobs:
133114
FORCE_COLOR: ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
134115
# Tox
135116
PY_COLORS: 1
117+
# Python -- Disable argparse help colors (3.14+)
118+
PYTHON_COLORS: 0
136119
# Mypy (see https://github.com/python/mypy/issues/7771)
137120
TERM: xterm-color
138121
MYPY_FORCE_COLOR: 1
@@ -142,6 +125,8 @@ jobs:
142125

143126
steps:
144127
- uses: actions/checkout@v4
128+
with:
129+
persist-credentials: false
145130

146131
- name: Debug build
147132
if: ${{ matrix.debug_build }}
@@ -173,7 +158,6 @@ jobs:
173158
if: ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
174159
with:
175160
python-version: ${{ matrix.python }}
176-
architecture: ${{ matrix.arch }}
177161

178162
- name: Install tox
179163
run: |
@@ -184,7 +168,7 @@ jobs:
184168
echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
185169
echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
186170
echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
187-
pip install setuptools==75.1.0 tox==4.21.2
171+
pip install setuptools==75.1.0 tox==4.26.0
188172
189173
- name: Compiled with mypyc
190174
if: ${{ matrix.test_mypyc }}
@@ -223,6 +207,8 @@ jobs:
223207
CC: i686-linux-gnu-gcc
224208
steps:
225209
- uses: actions/checkout@v4
210+
with:
211+
persist-credentials: false
226212
- name: Install 32-bit build dependencies
227213
run: |
228214
sudo dpkg --add-architecture i386 && \
@@ -245,7 +231,7 @@ jobs:
245231
default: 3.11.1
246232
command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
247233
- name: Install tox
248-
run: pip install setuptools==75.1.0 tox==4.21.2
234+
run: pip install setuptools==75.1.0 tox==4.26.0
249235
- name: Setup tox environment
250236
run: tox run -e py --notest
251237
- name: Test

.github/workflows/test_stubgenc.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ jobs:
2929
steps:
3030

3131
- uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
3234

33-
- name: Setup 🐍 3.8
35+
- name: Setup 🐍 3.9
3436
uses: actions/setup-python@v5
3537
with:
36-
python-version: 3.8
38+
python-version: 3.9
3739

3840
- name: Test stubgenc
3941
run: misc/test-stubgenc.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ venv/
1717
test-data/packages/.pip_lock
1818
dmypy.json
1919
.dmypy.json
20+
/.mypyc_test_output
2021

2122
# Packages
2223
*.egg

0 commit comments

Comments
 (0)