Skip to content

Commit 91059f8

Browse files
authored
Merge branch 'master' into fix-enum-truthyness
2 parents 22a2373 + 0c10dc3 commit 91059f8

File tree

138 files changed

+5757
-1512
lines changed

Some content is hidden

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

138 files changed

+5757
-1512
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ 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
4141
run: pip install tox==4.11.0
4242
- name: Setup tox environment

.github/workflows/test.yml

Lines changed: 67 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ jobs:
7070
toxenv: py
7171
tox_extra_args: "-n 4"
7272
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"
79+
test_mypyc: true
80+
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
7389

7490
- name: mypyc runtime tests with py39-macos
7591
python: '3.9.18'
@@ -78,13 +94,16 @@ jobs:
7894
os: macos-13
7995
toxenv: py
8096
tox_extra_args: "-n 3 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 4 mypyc/test/test_run.py mypyc/test/test_external.py"
87-
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
88107

89108
- name: Type check our own code (py38-ubuntu)
90109
python: '3.8'
@@ -119,51 +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==68.2.2 tox==4.11.0
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
144195
run: |
145196
tox run -e ${{ matrix.toxenv }} --notest
146-
python -c 'import os; print("os.cpu_count", os.cpu_count(), "os.sched_getaffinity", len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
147197
- name: Test
148198
run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
199+
continue-on-error: ${{ matrix.allow_failure == 'true' }}
149200

150-
python-nightly:
151-
runs-on: ubuntu-latest
152-
name: Test suite with Python nightly
153-
steps:
154-
- uses: actions/checkout@v3
155-
- uses: actions/setup-python@v4
156-
with:
157-
python-version: '3.13-dev'
158-
- name: Install tox
159-
run: pip install setuptools==68.2.2 tox==4.11.0
160-
- name: Setup tox environment
161-
run: tox run -e py --notest
162-
- name: Test
163-
run: tox run -e py --skip-pkg-install -- "-n 4"
164-
continue-on-error: true
165-
- name: Mark as a success
166-
run: exit 0
201+
- name: Mark as success (check failures manually)
202+
if: ${{ matrix.allow_failure == 'true' }}
203+
run: exit 0
167204

168205
python_32bits:
169206
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)