Skip to content

Commit be10149

Browse files
authored
Merge branch 'master' into ext_docgen
2 parents c3d0a79 + 2348b8d commit be10149

File tree

605 files changed

+16169
-4687
lines changed

Some content is hidden

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

605 files changed

+16169
-4687
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: 3 additions & 6 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,6 +36,7 @@ jobs:
3836
with:
3937
path: mypy_to_test
4038
fetch-depth: 0
39+
persist-credentials: false
4140
- uses: actions/setup-python@v5
4241
with:
4342
python-version: "3.12"
@@ -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: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,18 @@ 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'
34+
- name: Test suite with py39-ubuntu, mypyc-compiled
35+
python: '3.9'
3636
arch: x64
3737
os: ubuntu-latest
3838
toxenv: py
3939
tox_extra_args: "-n 4"
4040
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
41+
- name: Test suite with py39-windows-64
4842
python: '3.9'
4943
arch: x64
50-
os: ubuntu-latest
51-
toxenv: py
44+
os: windows-latest
45+
toxenv: py39
5246
tox_extra_args: "-n 4"
5347
- name: Test suite with py310-ubuntu
5448
python: '3.10'
@@ -88,7 +82,7 @@ jobs:
8882
# test_mypyc: true
8983

9084
- name: mypyc runtime tests with py39-macos
91-
python: '3.9.18'
85+
python: '3.9.21'
9286
arch: x64
9387
# TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
9488
os: macos-13
@@ -98,20 +92,20 @@ jobs:
9892
# - https://github.com/python/mypy/issues/17819
9993
# - https://github.com/python/mypy/pull/17822
10094
# - name: mypyc runtime tests with py38-debug-build-ubuntu
101-
# python: '3.8.17'
95+
# python: '3.9.21'
10296
# arch: x64
10397
# os: ubuntu-latest
10498
# toxenv: py
10599
# tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
106100
# debug_build: true
107101

108-
- name: Type check our own code (py38-ubuntu)
109-
python: '3.8'
102+
- name: Type check our own code (py39-ubuntu)
103+
python: '3.9'
110104
arch: x64
111105
os: ubuntu-latest
112106
toxenv: type
113-
- name: Type check our own code (py38-windows-64)
114-
python: '3.8'
107+
- name: Type check our own code (py39-windows-64)
108+
python: '3.9'
115109
arch: x64
116110
os: windows-latest
117111
toxenv: type
@@ -142,6 +136,8 @@ jobs:
142136

143137
steps:
144138
- uses: actions/checkout@v4
139+
with:
140+
persist-credentials: false
145141

146142
- name: Debug build
147143
if: ${{ matrix.debug_build }}
@@ -223,6 +219,8 @@ jobs:
223219
CC: i686-linux-gnu-gcc
224220
steps:
225221
- uses: actions/checkout@v4
222+
with:
223+
persist-credentials: false
226224
- name: Install 32-bit build dependencies
227225
run: |
228226
sudo dpkg --add-architecture i386 && \

.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

.pre-commit-config.yaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,49 @@
11
exclude: '^(mypyc/external/)|(mypy/typeshed/)|misc/typeshed_patches' # Exclude all vendored code from lints
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0 # must match test-requirements.txt
4+
rev: v5.0.0
55
hooks:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 24.8.0 # must match test-requirements.txt
9+
rev: 24.10.0
1010
hooks:
1111
- id: black
1212
exclude: '^(test-data/)'
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.6.9 # must match test-requirements.txt
14+
rev: v0.8.6
1515
hooks:
1616
- id: ruff
1717
args: [--exit-non-zero-on-fix]
1818
- repo: https://github.com/python-jsonschema/check-jsonschema
19-
rev: 0.29.4
19+
rev: 0.31.0
2020
hooks:
21-
- id: check-dependabot
2221
- id: check-github-workflows
22+
- id: check-github-actions
23+
- id: check-readthedocs
2324
- repo: https://github.com/rhysd/actionlint
24-
rev: v1.7.3
25+
rev: v1.7.6
2526
hooks:
2627
- id: actionlint
2728
args: [
2829
-ignore=property "debug_build" is not defined,
2930
-ignore=property "allow_failure" is not defined,
3031
-ignore=SC2(046|086),
3132
]
33+
additional_dependencies:
34+
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
35+
# and checks these with shellcheck. This is arguably its most useful feature,
36+
# but the integration only works if shellcheck is installed
37+
- "github.com/wasilibs/go-shellcheck/cmd/[email protected]"
38+
- repo: https://github.com/woodruffw/zizmor-pre-commit
39+
rev: v1.0.1
40+
hooks:
41+
- id: zizmor
42+
# Should be the last one:
43+
- repo: meta
44+
hooks:
45+
- id: check-hooks-apply
46+
- id: check-useless-excludes
47+
3248
ci:
3349
autoupdate_schedule: quarterly

0 commit comments

Comments
 (0)