Skip to content

Commit 4cc6db9

Browse files
authored
Merge branch 'master' into nondet
2 parents 77679f8 + a8ec893 commit 4cc6db9

File tree

513 files changed

+23166
-7364
lines changed

Some content is hidden

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

513 files changed

+23166
-7364
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ 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'

.github/workflows/mypy_primer.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626
mypy_primer:
2727
name: Run mypy_primer
2828
runs-on: ubuntu-latest
29-
permissions:
30-
contents: read
3129
strategy:
3230
matrix:
3331
shard-index: [0, 1, 2, 3, 4]
@@ -38,9 +36,10 @@ jobs:
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
@@ -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: 5 additions & 4 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

.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: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,57 +33,49 @@ jobs:
3333
# the oldest and newest supported Python versions
3434
- name: Test suite with py39-ubuntu, mypyc-compiled
3535
python: '3.9'
36-
arch: x64
37-
os: ubuntu-latest
36+
os: ubuntu-24.04-arm
3837
toxenv: py
3938
tox_extra_args: "-n 4"
4039
test_mypyc: true
4140
- name: Test suite with py39-windows-64
4241
python: '3.9'
43-
arch: x64
4442
os: windows-latest
4543
toxenv: py39
4644
tox_extra_args: "-n 4"
4745
- name: Test suite with py310-ubuntu
4846
python: '3.10'
49-
arch: x64
50-
os: ubuntu-latest
47+
os: ubuntu-24.04-arm
5148
toxenv: py
5249
tox_extra_args: "-n 4"
5350
- name: Test suite with py311-ubuntu, mypyc-compiled
5451
python: '3.11'
55-
arch: x64
56-
os: ubuntu-latest
52+
os: ubuntu-24.04-arm
5753
toxenv: py
5854
tox_extra_args: "-n 4"
5955
test_mypyc: true
6056
- name: Test suite with py312-ubuntu, mypyc-compiled
6157
python: '3.12'
62-
arch: x64
63-
os: ubuntu-latest
58+
os: ubuntu-24.04-arm
6459
toxenv: py
6560
tox_extra_args: "-n 4"
6661
test_mypyc: true
6762
- name: Test suite with py313-ubuntu, mypyc-compiled
6863
python: '3.13'
69-
arch: x64
70-
os: ubuntu-latest
64+
os: ubuntu-24.04-arm
7165
toxenv: py
7266
tox_extra_args: "-n 4"
7367
test_mypyc: true
7468

7569
# - name: Test suite with py314-dev-ubuntu
7670
# python: '3.14-dev'
77-
# arch: x64
78-
# os: ubuntu-latest
71+
# os: ubuntu-24.04-arm
7972
# toxenv: py
8073
# tox_extra_args: "-n 4"
8174
# allow_failure: true
8275
# test_mypyc: true
8376

8477
- name: mypyc runtime tests with py39-macos
8578
python: '3.9.21'
86-
arch: x64
8779
# TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
8880
os: macos-13
8981
toxenv: py
@@ -93,20 +85,17 @@ jobs:
9385
# - https://github.com/python/mypy/pull/17822
9486
# - name: mypyc runtime tests with py38-debug-build-ubuntu
9587
# python: '3.9.21'
96-
# arch: x64
9788
# os: ubuntu-latest
9889
# toxenv: py
9990
# tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
10091
# debug_build: true
10192

10293
- name: Type check our own code (py39-ubuntu)
10394
python: '3.9'
104-
arch: x64
10595
os: ubuntu-latest
10696
toxenv: type
10797
- name: Type check our own code (py39-windows-64)
10898
python: '3.9'
109-
arch: x64
11099
os: windows-latest
111100
toxenv: type
112101

@@ -115,7 +104,6 @@ jobs:
115104
# to ensure the tox env works as expected
116105
- name: Formatting and code style with Black + ruff
117106
python: '3.10'
118-
arch: x64
119107
os: ubuntu-latest
120108
toxenv: lint
121109

@@ -136,6 +124,8 @@ jobs:
136124

137125
steps:
138126
- uses: actions/checkout@v4
127+
with:
128+
persist-credentials: false
139129

140130
- name: Debug build
141131
if: ${{ matrix.debug_build }}
@@ -167,7 +157,6 @@ jobs:
167157
if: ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
168158
with:
169159
python-version: ${{ matrix.python }}
170-
architecture: ${{ matrix.arch }}
171160

172161
- name: Install tox
173162
run: |
@@ -217,6 +206,8 @@ jobs:
217206
CC: i686-linux-gnu-gcc
218207
steps:
219208
- uses: actions/checkout@v4
209+
with:
210+
persist-credentials: false
220211
- name: Install 32-bit build dependencies
221212
run: |
222213
sudo dpkg --add-architecture i386 && \

.github/workflows/test_stubgenc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
steps:
3030

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

3335
- name: Setup 🐍 3.9
3436
uses: actions/setup-python@v5

.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

.pre-commit-config.yaml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,59 @@ repos:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 24.10.0
9+
rev: 25.1.0
1010
hooks:
1111
- id: black
1212
exclude: '^(test-data/)'
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.8.4
14+
rev: v0.11.4
1515
hooks:
1616
- id: ruff
1717
args: [--exit-non-zero-on-fix]
1818
- repo: https://github.com/python-jsonschema/check-jsonschema
19-
rev: 0.30.0
19+
rev: 0.32.1
2020
hooks:
21-
- id: check-dependabot
2221
- id: check-github-workflows
22+
- id: check-github-actions
23+
- id: check-readthedocs
24+
- repo: https://github.com/codespell-project/codespell
25+
rev: v2.4.1
26+
hooks:
27+
- id: codespell
28+
args:
29+
- --ignore-words-list=HAX,ccompiler,ot,statics,whet,zar
30+
exclude: ^(mypy/test/|mypy/typeshed/|mypyc/test-data/|test-data/).+$
2331
- repo: https://github.com/rhysd/actionlint
24-
rev: v1.7.4
32+
rev: v1.7.7
2533
hooks:
2634
- id: actionlint
2735
args: [
2836
-ignore=property "debug_build" is not defined,
2937
-ignore=property "allow_failure" is not defined,
3038
-ignore=SC2(046|086),
3139
]
40+
additional_dependencies:
41+
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
42+
# and checks these with shellcheck. This is arguably its most useful feature,
43+
# but the integration only works if shellcheck is installed
44+
- "github.com/wasilibs/go-shellcheck/cmd/[email protected]"
45+
- repo: https://github.com/woodruffw/zizmor-pre-commit
46+
rev: v1.5.2
47+
hooks:
48+
- id: zizmor
49+
- repo: local
50+
hooks:
51+
- id: bad-pr-link
52+
name: Bad PR link
53+
description: Detect PR links text that don't match their URL
54+
language: pygrep
55+
entry: '\[(\d+)\]\(https://github.com/python/mypy/pull/(?!\1/?\))\d+/?\)'
56+
files: CHANGELOG.md
57+
# Should be the last one:
58+
- repo: meta
59+
hooks:
60+
- id: check-hooks-apply
61+
- id: check-useless-excludes
62+
3263
ci:
3364
autoupdate_schedule: quarterly

0 commit comments

Comments
 (0)