Skip to content

Commit 60ded21

Browse files
authored
Merge branch 'master' into issue-17117
2 parents 116f27d + d1a7d09 commit 60ded21

File tree

580 files changed

+27590
-8634
lines changed

Some content is hidden

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

580 files changed

+27590
-8634
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/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
- uses: actions/checkout@v4
3737
- uses: actions/setup-python@v5
3838
with:
39-
python-version: '3.8'
39+
python-version: '3.12'
4040
- name: Install tox
41-
run: pip install --upgrade 'setuptools!=50' tox==4.11.0
41+
run: pip install tox==4.21.2
4242
- name: Setup tox environment
4343
run: tox run -e ${{ env.TOXENV }} --notest
4444
- name: Test

.github/workflows/mypy_primer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
fetch-depth: 0
4040
- uses: actions/setup-python@v5
4141
with:
42-
python-version: "3.10"
42+
python-version: "3.12"
4343
- name: Install dependencies
4444
run: |
4545
python -m pip install -U pip

.github/workflows/test.yml

Lines changed: 81 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,55 +36,74 @@ jobs:
3636
arch: x64
3737
os: ubuntu-latest
3838
toxenv: py
39-
tox_extra_args: "-n 2"
39+
tox_extra_args: "-n 4"
4040
test_mypyc: true
4141
- name: Test suite with py38-windows-64
4242
python: '3.8'
4343
arch: x64
4444
os: windows-latest
4545
toxenv: py38
46-
tox_extra_args: "-n 2"
46+
tox_extra_args: "-n 4"
4747
- name: Test suite with py39-ubuntu
4848
python: '3.9'
4949
arch: x64
5050
os: ubuntu-latest
5151
toxenv: py
52-
tox_extra_args: "-n 2"
52+
tox_extra_args: "-n 4"
5353
- name: Test suite with py310-ubuntu
5454
python: '3.10'
5555
arch: x64
5656
os: ubuntu-latest
5757
toxenv: py
58-
tox_extra_args: "-n 2"
58+
tox_extra_args: "-n 4"
5959
- name: Test suite with py311-ubuntu, mypyc-compiled
6060
python: '3.11'
6161
arch: x64
6262
os: ubuntu-latest
6363
toxenv: py
64-
tox_extra_args: "-n 2"
64+
tox_extra_args: "-n 4"
6565
test_mypyc: true
6666
- name: Test suite with py312-ubuntu, mypyc-compiled
6767
python: '3.12'
6868
arch: x64
6969
os: ubuntu-latest
7070
toxenv: py
71-
tox_extra_args: "-n 2"
71+
tox_extra_args: "-n 4"
72+
test_mypyc: true
73+
- name: Test suite with py313-ubuntu, mypyc-compiled
74+
python: '3.13'
75+
arch: x64
76+
os: ubuntu-latest
77+
toxenv: py
78+
tox_extra_args: "-n 4"
7279
test_mypyc: true
7380

81+
# - name: Test suite with py314-dev-ubuntu
82+
# python: '3.14-dev'
83+
# arch: x64
84+
# os: ubuntu-latest
85+
# toxenv: py
86+
# tox_extra_args: "-n 4"
87+
# allow_failure: true
88+
# test_mypyc: true
89+
7490
- name: mypyc runtime tests with py39-macos
7591
python: '3.9.18'
7692
arch: x64
7793
# TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
7894
os: macos-13
7995
toxenv: py
80-
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
81-
- name: mypyc runtime tests with py38-debug-build-ubuntu
82-
python: '3.8.17'
83-
arch: x64
84-
os: ubuntu-latest
85-
toxenv: py
86-
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
87-
debug_build: true
96+
tox_extra_args: "-n 3 mypyc/test/test_run.py mypyc/test/test_external.py"
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
88107

89108
- name: Type check our own code (py38-ubuntu)
90109
python: '3.8'
@@ -109,8 +128,8 @@ jobs:
109128
name: ${{ matrix.name }}
110129
env:
111130
TOX_SKIP_MISSING_INTERPRETERS: False
112-
# Rich (pip)
113-
FORCE_COLOR: 1
131+
# Rich (pip) -- Disable color for windows + pytest
132+
FORCE_COLOR: ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
114133
# Tox
115134
PY_COLORS: 1
116135
# Mypy (see https://github.com/python/mypy/issues/7771)
@@ -119,31 +138,69 @@ jobs:
119138
MYPY_FORCE_TERMINAL_WIDTH: 200
120139
# Pytest
121140
PYTEST_ADDOPTS: --color=yes
141+
122142
steps:
123143
- uses: actions/checkout@v4
124-
- uses: actions/setup-python@v5
125-
with:
126-
python-version: ${{ matrix.python }}
127-
architecture: ${{ matrix.arch }}
144+
128145
- name: Debug build
129146
if: ${{ matrix.debug_build }}
130147
run: |
131148
PYTHONVERSION=${{ matrix.python }}
132149
PYTHONDIR=~/python-debug/python-$PYTHONVERSION
133150
VENV=$PYTHONDIR/env
134151
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
152+
# TODO: does this do anything? env vars aren't passed to the next step right
135153
source $VENV/bin/activate
154+
- name: Latest dev build
155+
if: ${{ endsWith(matrix.python, '-dev') }}
156+
run: |
157+
git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
158+
cd /tmp/cpython
159+
echo git rev-parse HEAD; git rev-parse HEAD
160+
git show --no-patch
161+
sudo apt-get update
162+
sudo apt-get install -y --no-install-recommends \
163+
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
164+
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
165+
./configure --prefix=/opt/pythondev
166+
make -j$(nproc)
167+
sudo make install
168+
sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
169+
sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
170+
echo "/opt/pythondev/bin" >> $GITHUB_PATH
171+
- uses: actions/setup-python@v5
172+
if: ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
173+
with:
174+
python-version: ${{ matrix.python }}
175+
architecture: ${{ matrix.arch }}
176+
136177
- name: Install tox
137-
run: pip install setuptools==68.2.2 tox==4.11.0
178+
run: |
179+
echo PATH; echo $PATH
180+
echo which python; which python
181+
echo which pip; which pip
182+
echo python version; python -c 'import sys; print(sys.version)'
183+
echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
184+
echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
185+
echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
186+
pip install setuptools==75.1.0 tox==4.21.2
187+
138188
- name: Compiled with mypyc
139189
if: ${{ matrix.test_mypyc }}
140190
run: |
141191
pip install -r test-requirements.txt
142192
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
193+
143194
- name: Setup tox environment
144-
run: tox run -e ${{ matrix.toxenv }} --notest
195+
run: |
196+
tox run -e ${{ matrix.toxenv }} --notest
145197
- name: Test
146198
run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
199+
continue-on-error: ${{ matrix.allow_failure == 'true' }}
200+
201+
- name: Mark as success (check failures manually)
202+
if: ${{ matrix.allow_failure == 'true' }}
203+
run: exit 0
147204

148205
python_32bits:
149206
runs-on: ubuntu-latest
@@ -186,8 +243,8 @@ jobs:
186243
default: 3.11.1
187244
command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
188245
- name: Install tox
189-
run: pip install setuptools==68.2.2 tox==4.11.0
246+
run: pip install setuptools==75.1.0 tox==4.21.2
190247
- name: Setup tox environment
191248
run: tox run -e py --notest
192249
- name: Test
193-
run: tox run -e py --skip-pkg-install -- -n 2 mypyc/test/
250+
run: tox run -e py --skip-pkg-install -- -n 4 mypyc/test/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ repos:
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.8.0 # must match test-requirements.txt
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.6.9 # must match test-requirements.txt
1515
hooks:
1616
- id: ruff
1717
args: [--exit-non-zero-on-fix]

0 commit comments

Comments
 (0)