Skip to content

Commit f87fde7

Browse files
authored
Merge branch 'master' into patch-1
2 parents dad9b05 + 1b8841b commit f87fde7

File tree

1,337 files changed

+135725
-46229
lines changed

Some content is hidden

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

1,337 files changed

+135725
-46229
lines changed

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
f98f78216ba9d6ab68c8e69c19e9f3c7926c5efe
77
# run pyupgrade (#12711)
88
fc335cb16315964b923eb1927e3aad1516891c28
9+
# update black to 23.3.0 (#15059)
10+
4276308be01ea498d946a79554b4a10b1cf13ccb
11+
# Update black to 24.1.1 (#16847)
12+
8107e53158d83d30bb04d290ac10d8d3ccd344f8

.github/ISSUE_TEMPLATE/crash.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ labels: "crash"
1515

1616
**Traceback**
1717

18-
```
18+
```python-traceback
1919
(Insert traceback and other messages from mypy here -- use `--show-traceback`.)
2020
```
2121

@@ -25,6 +25,11 @@ labels: "crash"
2525
appreciated. We also very much appreciate it if you try to narrow the
2626
source down to a small stand-alone example.)
2727

28+
```python
29+
# Ideally, a small sample program that demonstrates the problem.
30+
# Or even better, a reproducible playground link https://mypy-play.net/ (use the "Gist" button)
31+
```
32+
2833
**Your Environment**
2934

3035
<!-- Include as many relevant details about the environment you experienced the bug in -->

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ labels: "feature"
66

77
**Feature**
88

9-
(A clear and concise description of your feature proposal.)
9+
<!-- Enter a clear and concise description of your feature proposal here. -->
1010

1111
**Pitch**
1212

13-
(Please explain why this feature should be implemented and how it would be used. Add examples, if applicable.)
13+
<!-- Please explain why this feature should be implemented and how it would be used. Add examples, if applicable. -->

.github/workflows/build_wheels.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ on:
55
branches: [main, master, 'release*']
66
tags: ['*']
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build-wheels:
1013
if: github.repository == 'python/mypy'
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-python@v4
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-python@v5
1520
with:
1621
python-version: '3.11'
1722
- name: Trigger script

.github/workflows/docs.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,43 @@ on:
88
pull_request:
99
paths:
1010
- 'docs/**'
11+
# We now have a docs check that fails if any error codes don't have documentation,
12+
# so it's important to do the docs build on all PRs touching mypy/errorcodes.py
13+
# in case somebody's adding a new error code without any docs
14+
- 'mypy/errorcodes.py'
15+
# Part of the documentation is automatically generated from the options
16+
# definitions in mypy/main.py
17+
- 'mypy/main.py'
1118
- 'mypyc/doc/**'
1219
- '**/*.rst'
1320
- '**/*.md'
1421
- CREDITS
1522
- LICENSE
1623

24+
permissions:
25+
contents: read
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
29+
cancel-in-progress: true
30+
1731
jobs:
1832
docs:
1933
runs-on: ubuntu-latest
34+
timeout-minutes: 10
2035
env:
2136
TOXENV: docs
2237
TOX_SKIP_MISSING_INTERPRETERS: False
2338
VERIFY_MYPY_ERROR_CODES: 1
2439
steps:
25-
- uses: actions/checkout@v3
26-
- uses: actions/setup-python@v4
40+
- uses: actions/checkout@v4
41+
with:
42+
persist-credentials: false
43+
- uses: actions/setup-python@v5
2744
with:
28-
python-version: '3.8'
45+
python-version: '3.12'
2946
- name: Install tox
30-
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
47+
run: pip install tox==4.26.0
3148
- name: Setup tox environment
3249
run: tox run -e ${{ env.TOXENV }} --notest
3350
- name: Test

.github/workflows/mypy_primer.yml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- 'mypy/test/**'
1616
- 'test-data/**'
1717

18+
permissions:
19+
contents: read
20+
1821
concurrency:
1922
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2023
cancel-in-progress: true
@@ -23,20 +26,20 @@ jobs:
2326
mypy_primer:
2427
name: Run mypy_primer
2528
runs-on: ubuntu-latest
26-
permissions:
27-
contents: read
2829
strategy:
2930
matrix:
30-
shard-index: [0, 1, 2, 3, 4]
31+
shard-index: [0, 1, 2, 3, 4, 5]
3132
fail-fast: false
33+
timeout-minutes: 60
3234
steps:
33-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3436
with:
3537
path: mypy_to_test
3638
fetch-depth: 0
37-
- uses: actions/setup-python@v4
39+
persist-credentials: false
40+
- uses: actions/setup-python@v5
3841
with:
39-
python-version: "3.10"
42+
python-version: "3.13"
4043
- name: Install dependencies
4144
run: |
4245
python -m pip install -U pip
@@ -60,24 +63,40 @@ jobs:
6063
mypy_primer \
6164
--repo mypy_to_test \
6265
--new $GITHUB_SHA --old base_commit \
63-
--num-shards 5 --shard-index ${{ matrix.shard-index }} \
66+
--num-shards 6 --shard-index ${{ matrix.shard-index }} \
6467
--debug \
6568
--additional-flags="--debug-serialize" \
6669
--output concise \
70+
--mypy-install-librt \
6771
| tee diff_${{ matrix.shard-index }}.txt
6872
) || [ $? -eq 1 ]
69-
- name: Upload mypy_primer diff
70-
uses: actions/upload-artifact@v3
71-
with:
72-
name: mypy_primer_diffs
73-
path: diff_${{ matrix.shard-index }}.txt
74-
- if: ${{ matrix.shard-index }} == 0
73+
- if: ${{ matrix.shard-index == 0 }}
7574
name: Save PR number
7675
run: |
7776
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
78-
- if: ${{ matrix.shard-index }} == 0
79-
name: Upload PR number
80-
uses: actions/upload-artifact@v3
77+
- name: Upload mypy_primer diff + PR number
78+
uses: actions/upload-artifact@v4
79+
if: ${{ matrix.shard-index == 0 }}
80+
with:
81+
name: mypy_primer_diffs-${{ matrix.shard-index }}
82+
path: |
83+
diff_${{ matrix.shard-index }}.txt
84+
pr_number.txt
85+
- name: Upload mypy_primer diff
86+
uses: actions/upload-artifact@v4
87+
if: ${{ matrix.shard-index != 0 }}
88+
with:
89+
name: mypy_primer_diffs-${{ matrix.shard-index }}
90+
path: diff_${{ matrix.shard-index }}.txt
91+
92+
join_artifacts:
93+
name: Join artifacts
94+
runs-on: ubuntu-latest
95+
needs: [mypy_primer]
96+
steps:
97+
- name: Merge artifacts
98+
uses: actions/upload-artifact/merge@v4
8199
with:
82100
name: mypy_primer_diffs
83-
path: pr_number.txt
101+
pattern: mypy_primer_diffs-*
102+
delete-merged: true

.github/workflows/mypy_primer_comment.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
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
21-
uses: actions/github-script@v6
22+
uses: actions/github-script@v7
2223
with:
2324
script: |
2425
const fs = require('fs');
@@ -44,11 +45,11 @@ jobs:
4445
4546
- name: Post comment
4647
id: post-comment
47-
uses: actions/github-script@v6
48+
uses: actions/github-script@v7
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: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ 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
18+
timeout-minutes: 10
1719
steps:
18-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1921
with:
2022
fetch-depth: 0
23+
persist-credentials: true # needed to `git push` the PR branch
2124
# TODO: use whatever solution ends up working for
2225
# https://github.com/python/typeshed/issues/8434
23-
- uses: actions/setup-python@v4
26+
- uses: actions/setup-python@v5
2427
with:
2528
python-version: "3.10"
2629
- name: git config

0 commit comments

Comments
 (0)