Skip to content

Commit 6a9b777

Browse files
Merge branch 'master' into mypy-ignore
2 parents f319d54 + ee1f4c9 commit 6a9b777

File tree

684 files changed

+24601
-9389
lines changed

Some content is hidden

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

684 files changed

+24601
-9389
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ concurrency:
2828
jobs:
2929
docs:
3030
runs-on: ubuntu-latest
31+
timeout-minutes: 10
3132
env:
3233
TOXENV: docs
3334
TOX_SKIP_MISSING_INTERPRETERS: False
@@ -38,7 +39,7 @@ jobs:
3839
with:
3940
python-version: '3.12'
4041
- name: Install tox
41-
run: pip install tox==4.11.0
42+
run: pip install tox==4.21.2
4243
- name: Setup tox environment
4344
run: tox run -e ${{ env.TOXENV }} --notest
4445
- name: Test

.github/workflows/mypy_primer.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
matrix:
3333
shard-index: [0, 1, 2, 3, 4]
3434
fail-fast: false
35+
timeout-minutes: 60
3536
steps:
3637
- uses: actions/checkout@v4
3738
with:
@@ -69,18 +70,35 @@ jobs:
6970
--output concise \
7071
| tee diff_${{ matrix.shard-index }}.txt
7172
) || [ $? -eq 1 ]
72-
- name: Upload mypy_primer diff
73-
uses: actions/upload-artifact@v3
74-
with:
75-
name: mypy_primer_diffs
76-
path: diff_${{ matrix.shard-index }}.txt
77-
- if: ${{ matrix.shard-index }} == 0
73+
- if: ${{ matrix.shard-index == 0 }}
7874
name: Save PR number
7975
run: |
8076
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
81-
- if: ${{ matrix.shard-index }} == 0
82-
name: Upload PR number
83-
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+
permissions:
97+
contents: read
98+
steps:
99+
- name: Merge artifacts
100+
uses: actions/upload-artifact/merge@v4
84101
with:
85102
name: mypy_primer_diffs
86-
path: pr_number.txt
103+
pattern: mypy_primer_diffs-*
104+
delete-merged: true

.github/workflows/mypy_primer_comment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1919
steps:
2020
- name: Download diffs
21-
uses: actions/github-script@v6
21+
uses: actions/github-script@v7
2222
with:
2323
script: |
2424
const fs = require('fs');
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
github-token: ${{ secrets.GITHUB_TOKEN }}
5050
script: |
51-
const MAX_CHARACTERS = 30000
51+
const MAX_CHARACTERS = 50000
5252
const MAX_CHARACTERS_PER_PROJECT = MAX_CHARACTERS / 3
5353
5454
const fs = require('fs')

.github/workflows/sync_typeshed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
name: Sync typeshed
1515
if: github.repository == 'python/mypy'
1616
runs-on: ubuntu-latest
17+
timeout-minutes: 10
1718
steps:
1819
- uses: actions/checkout@v4
1920
with:

.github/workflows/test.yml

Lines changed: 35 additions & 36 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'
@@ -70,14 +64,14 @@ jobs:
7064
toxenv: py
7165
tox_extra_args: "-n 4"
7266
test_mypyc: true
73-
74-
- name: Test suite with py313-dev-ubuntu, mypyc-compiled
75-
python: '3.13-dev'
67+
- name: Test suite with py313-ubuntu, mypyc-compiled
68+
python: '3.13'
7669
arch: x64
7770
os: ubuntu-latest
7871
toxenv: py
7972
tox_extra_args: "-n 4"
8073
test_mypyc: true
74+
8175
# - name: Test suite with py314-dev-ubuntu
8276
# python: '3.14-dev'
8377
# arch: x64
@@ -88,27 +82,30 @@ 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
9589
toxenv: py
9690
tox_extra_args: "-n 3 mypyc/test/test_run.py mypyc/test/test_external.py"
97-
- name: mypyc runtime tests with py38-debug-build-ubuntu
98-
python: '3.8.17'
99-
arch: x64
100-
os: ubuntu-latest
101-
toxenv: py
102-
tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
103-
debug_build: true
91+
# This is broken. See
92+
# - https://github.com/python/mypy/issues/17819
93+
# - https://github.com/python/mypy/pull/17822
94+
# - name: mypyc runtime tests with py38-debug-build-ubuntu
95+
# python: '3.9.21'
96+
# arch: x64
97+
# os: ubuntu-latest
98+
# toxenv: py
99+
# tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
100+
# debug_build: true
104101

105-
- name: Type check our own code (py38-ubuntu)
106-
python: '3.8'
102+
- name: Type check our own code (py39-ubuntu)
103+
python: '3.9'
107104
arch: x64
108105
os: ubuntu-latest
109106
toxenv: type
110-
- name: Type check our own code (py38-windows-64)
111-
python: '3.8'
107+
- name: Type check our own code (py39-windows-64)
108+
python: '3.9'
112109
arch: x64
113110
os: windows-latest
114111
toxenv: type
@@ -123,10 +120,11 @@ jobs:
123120
toxenv: lint
124121

125122
name: ${{ matrix.name }}
123+
timeout-minutes: 60
126124
env:
127125
TOX_SKIP_MISSING_INTERPRETERS: False
128-
# Rich (pip)
129-
FORCE_COLOR: 1
126+
# Rich (pip) -- Disable color for windows + pytest
127+
FORCE_COLOR: ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
130128
# Tox
131129
PY_COLORS: 1
132130
# Mypy (see https://github.com/python/mypy/issues/7771)
@@ -148,17 +146,17 @@ jobs:
148146
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
149147
# TODO: does this do anything? env vars aren't passed to the next step right
150148
source $VENV/bin/activate
151-
- name: Latest Dev build
149+
- name: Latest dev build
152150
if: ${{ endsWith(matrix.python, '-dev') }}
153151
run: |
154-
sudo apt-get update
155-
sudo apt-get install -y --no-install-recommends \
156-
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
157-
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
158152
git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
159153
cd /tmp/cpython
160154
echo git rev-parse HEAD; git rev-parse HEAD
161155
git show --no-patch
156+
sudo apt-get update
157+
sudo apt-get install -y --no-install-recommends \
158+
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
159+
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
162160
./configure --prefix=/opt/pythondev
163161
make -j$(nproc)
164162
sudo make install
@@ -180,7 +178,7 @@ jobs:
180178
echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
181179
echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
182180
echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
183-
pip install setuptools==68.2.2 tox==4.11.0
181+
pip install setuptools==75.1.0 tox==4.21.2
184182
185183
- name: Compiled with mypyc
186184
if: ${{ matrix.test_mypyc }}
@@ -190,7 +188,7 @@ jobs:
190188
191189
- name: Setup tox environment
192190
run: |
193-
tox run -e ${{ matrix.toxenv }} --notes
191+
tox run -e ${{ matrix.toxenv }} --notest
194192
- name: Test
195193
run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
196194
continue-on-error: ${{ matrix.allow_failure == 'true' }}
@@ -202,6 +200,7 @@ jobs:
202200
python_32bits:
203201
runs-on: ubuntu-latest
204202
name: Test mypyc suite with 32-bit Python
203+
timeout-minutes: 60
205204
env:
206205
TOX_SKIP_MISSING_INTERPRETERS: False
207206
# Rich (pip)
@@ -240,7 +239,7 @@ jobs:
240239
default: 3.11.1
241240
command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
242241
- name: Install tox
243-
run: pip install setuptools==68.2.2 tox==4.11.0
242+
run: pip install setuptools==75.1.0 tox==4.21.2
244243
- name: Setup tox environment
245244
run: tox run -e py --notest
246245
- name: Test

.github/workflows/test_stubgenc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ jobs:
2525
# Check stub file generation for a small pybind11 project
2626
# (full text match is required to pass)
2727
runs-on: ubuntu-latest
28+
timeout-minutes: 10
2829
steps:
2930

3031
- uses: actions/checkout@v4
3132

32-
- name: Setup 🐍 3.8
33+
- name: Setup 🐍 3.9
3334
uses: actions/setup-python@v5
3435
with:
35-
python-version: 3.8
36+
python-version: 3.9
3637

3738
- name: Test stubgenc
3839
run: misc/test-stubgenc.sh

.pre-commit-config.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
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.1.1 # 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.2.0 # must match test-requirements.txt
14+
rev: v0.8.6
1515
hooks:
1616
- id: ruff
1717
args: [--exit-non-zero-on-fix]
18+
- repo: https://github.com/python-jsonschema/check-jsonschema
19+
rev: 0.30.0
20+
hooks:
21+
- id: check-dependabot
22+
- id: check-github-workflows
23+
- repo: https://github.com/rhysd/actionlint
24+
rev: v1.7.6
25+
hooks:
26+
- id: actionlint
27+
args: [
28+
-ignore=property "debug_build" is not defined,
29+
-ignore=property "allow_failure" is not defined,
30+
-ignore=SC2(046|086),
31+
]
1832
ci:
1933
autoupdate_schedule: quarterly

0 commit comments

Comments
 (0)