Skip to content

Commit f24781b

Browse files
committed
Merge tag '1.14-fork' into merge-upstream
# Conflicts: # CHANGELOG.md # CONTRIBUTING.md # MANIFEST.in # docs/source/conf.py # docs/source/config_file.rst # misc/apply-cache-diff.py # misc/diff-cache.py # mypy/binder.py # mypy/build.py # mypy/checker.py # mypy/checkexpr.py # mypy/constraints.py # mypy/errors.py # mypy/fastparse.py # mypy/main.py # mypy/modulefinder.py # mypy/nodes.py # mypy/options.py # mypy/semanal.py # mypy/test/data.py # mypy/typeanal.py # mypy/typeshed/stdlib/_operator.pyi # mypy/typeshed/stdlib/contextvars.pyi # mypy/typeshed/stdlib/fileinput.pyi # mypy/typeshed/stdlib/importlib/machinery.pyi # mypy/typeshed/stdlib/io.pyi # mypy/typeshed/stdlib/multiprocessing/managers.pyi # mypy/typeshed/stdlib/os/__init__.pyi # mypy/typeshed/stdlib/re.pyi # mypy/util.py # pyproject.toml # setup.py # test-data/unit/check-enum.test # test-data/unit/check-modules.test # test-data/unit/check-protocols.test # test-data/unit/check-python313.test # test-data/unit/check-typevar-defaults.test # test-data/unit/check-varargs.test # test-data/unit/cmdline.test # test-data/unit/pythoneval.test
2 parents f1a7595 + 5082a22 commit f24781b

File tree

529 files changed

+18864
-7749
lines changed

Some content is hidden

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

529 files changed

+18864
-7749
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:
@@ -72,18 +73,35 @@ jobs:
7273
--project-selector "^(?!https://github.com/(spack/spack|mitmproxy/mitmproxy))" \
7374
| tee diff_${{ matrix.shard-index }}.txt
7475
) || [ $? -eq 1 ]
75-
- name: Upload mypy_primer diff
76-
uses: actions/upload-artifact@v3
77-
with:
78-
name: mypy_primer_diffs
79-
path: diff_${{ matrix.shard-index }}.txt
80-
- if: ${{ matrix.shard-index }} == 0
76+
- if: ${{ matrix.shard-index == 0 }}
8177
name: Save PR number
8278
run: |
8379
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
84-
- if: ${{ matrix.shard-index }} == 0
85-
name: Upload PR number
86-
uses: actions/upload-artifact@v3
80+
- if: ${{ matrix.shard-index == 0 }}
81+
name: Upload mypy_primer diff + PR number
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: mypy_primer_diffs-${{ matrix.shard-index }}
85+
path: |
86+
diff_${{ matrix.shard-index }}.txt
87+
pr_number.txt
88+
- name: Upload mypy_primer diff
89+
uses: actions/upload-artifact@v4
90+
if: ${{ matrix.shard-index != 0 }}
91+
with:
92+
name: mypy_primer_diffs-${{ matrix.shard-index }}
93+
path: diff_${{ matrix.shard-index }}.txt
94+
95+
join_artifacts:
96+
name: Join artifacts
97+
runs-on: ubuntu-latest
98+
needs: [mypy_primer]
99+
permissions:
100+
contents: read
101+
steps:
102+
- name: Merge artifacts
103+
uses: actions/upload-artifact/merge@v4
87104
with:
88105
name: mypy_primer_diffs
89-
path: pr_number.txt
106+
pattern: mypy_primer_diffs-*
107+
delete-merged: true

.github/workflows/mypy_primer_comment.yml

Lines changed: 1 addition & 1 deletion
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');

.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: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ jobs:
7070
toxenv: py
7171
tox_extra_args: "-n 4"
7272
test_mypyc: true
73-
74-
- name: Test suite with py313-dev-ubuntu, mypyc-compiled
75-
python: '3.13-dev'
73+
- name: Test suite with py313-ubuntu, mypyc-compiled
74+
python: '3.13'
7675
arch: x64
7776
os: ubuntu-latest
7877
toxenv: py
7978
tox_extra_args: "-n 4"
8079
test_mypyc: true
80+
8181
# - name: Test suite with py314-dev-ubuntu
8282
# python: '3.14-dev'
8383
# arch: x64
@@ -94,13 +94,16 @@ jobs:
9494
os: macos-13
9595
toxenv: py
9696
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
97+
# This is broken. See
98+
# - https://github.com/python/mypy/issues/17819
99+
# - https://github.com/python/mypy/pull/17822
100+
# - name: mypyc runtime tests with py38-debug-build-ubuntu
101+
# python: '3.8.17'
102+
# arch: x64
103+
# os: ubuntu-latest
104+
# toxenv: py
105+
# tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
106+
# debug_build: true
104107

105108
- name: Type check our own code (py38-ubuntu)
106109
python: '3.8'
@@ -123,10 +126,11 @@ jobs:
123126
toxenv: lint
124127

125128
name: ${{ matrix.name }}
129+
timeout-minutes: 60
126130
env:
127131
TOX_SKIP_MISSING_INTERPRETERS: False
128-
# Rich (pip)
129-
FORCE_COLOR: 1
132+
# Rich (pip) -- Disable color for windows + pytest
133+
FORCE_COLOR: ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
130134
# Tox
131135
PY_COLORS: 1
132136
# Pytest
@@ -144,17 +148,17 @@ jobs:
144148
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
145149
# TODO: does this do anything? env vars aren't passed to the next step right
146150
source $VENV/bin/activate
147-
- name: Latest Dev build
151+
- name: Latest dev build
148152
if: ${{ endsWith(matrix.python, '-dev') }}
149153
run: |
150-
sudo apt-get update
151-
sudo apt-get install -y --no-install-recommends \
152-
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
153-
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
154154
git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
155155
cd /tmp/cpython
156156
echo git rev-parse HEAD; git rev-parse HEAD
157157
git show --no-patch
158+
sudo apt-get update
159+
sudo apt-get install -y --no-install-recommends \
160+
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
161+
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
158162
./configure --prefix=/opt/pythondev
159163
make -j$(nproc)
160164
sudo make install
@@ -176,7 +180,7 @@ jobs:
176180
echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
177181
echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
178182
echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
179-
pip install setuptools==68.2.2 tox==4.11.0
183+
pip install setuptools==75.1.0 tox==4.21.2
180184
181185
- name: Compiled with mypyc
182186
if: ${{ matrix.test_mypyc }}
@@ -186,7 +190,7 @@ jobs:
186190
187191
- name: Setup tox environment
188192
run: |
189-
tox run -e ${{ matrix.toxenv }} --notes
193+
tox run -e ${{ matrix.toxenv }} --notest
190194
- name: Test
191195
run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
192196
continue-on-error: ${{ matrix.allow_failure == 'true' }}
@@ -198,6 +202,7 @@ jobs:
198202
python_32bits:
199203
runs-on: ubuntu-latest
200204
name: Test mypyc suite with 32-bit Python
205+
timeout-minutes: 60
201206
env:
202207
TOX_SKIP_MISSING_INTERPRETERS: False
203208
# Rich (pip)
@@ -232,7 +237,7 @@ jobs:
232237
default: 3.11.1
233238
command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
234239
- name: Install tox
235-
run: pip install setuptools==68.2.2 tox==4.11.0
240+
run: pip install setuptools==75.1.0 tox==4.21.2
236241
- name: Setup tox environment
237242
run: tox run -e py --notest
238243
- name: Test

.github/workflows/test_stubgenc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ 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

0 commit comments

Comments
 (0)