Skip to content

Commit c1462ba

Browse files
authored
Merge pull request #258 from mwcraig/update-build-matrix-pt312
Update build matrix for Python 3.12
2 parents 0e51b2f + 5aa8ddc commit c1462ba

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: Test/build
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch: # Allows manual triggering
5+
push: # only build on pusheess to the main branch
6+
branches:
7+
- master
8+
pull_request:
9+
10+
# Stop current actions if there is a new push to the same branch
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
414

515
jobs:
616
build:
@@ -9,8 +19,18 @@ jobs:
919
max-parallel: 4
1020
fail-fast: false
1121
matrix:
12-
python-version: [3.8, 3.9, '3.10', 3.11]
22+
python-version: [3.11, 3.12]
1323
platform: [ubuntu-latest, macos-latest, windows-latest]
24+
# The include below adds jobs on older versions of python,
25+
# but just on one platform. Windows is probably the most widely
26+
# used for vpython, so test on that.
27+
include:
28+
- python-version: "3.8"
29+
platform: windows-latest
30+
- python-version: "3.9"
31+
platform: windows-latest
32+
- python-version: "3.10"
33+
platform: windows-latest
1434
runs-on: ${{ matrix.platform }}
1535

1636
steps:
@@ -62,7 +82,7 @@ jobs:
6282
strategy:
6383
fail-fast: false
6484
matrix:
65-
python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311]
85+
python-version: [cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
6686
runs-on: ubuntu-latest
6787
env:
6888
py: /opt/python/${{ matrix.python-version }}/bin/python
@@ -84,9 +104,9 @@ jobs:
84104
source .env/bin/activate && \
85105
echo -e "\e[1;34m Install dependencies \e[0m" && \
86106
python -m pip install --upgrade pip && \
87-
pip install pytest Cython wheel && \
107+
pip install pytest Cython wheel build && \
88108
echo -e "\e[1;34m Build wheel \e[0m" && \
89-
python setup.py bdist_wheel && \
109+
python -m build && \
90110
echo -e "\e[1;34m Install vpython \e[0m" && \
91111
pip install . && \
92112
echo -e "\e[1;34m Run tests \e[0m" && \

.github/workflows/upload_pypi.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
max-parallel: 4
1212
fail-fast: false
1313
matrix:
14-
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
14+
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
1515
platform: [macos-latest, windows-latest] # Wheels on linux below
1616
runs-on: ${{ matrix.platform }}
1717

@@ -48,7 +48,7 @@ jobs:
4848
- name: Set up Python
4949
uses: actions/setup-python@v5
5050
with:
51-
python-version: 3.10
51+
python-version: 3.11
5252
- name: Stable with rustfmt and clippy
5353
uses: actions-rs/toolchain@v1
5454
with:
@@ -61,7 +61,7 @@ jobs:
6161
- name: Python wheels manylinux build
6262
uses: RalfG/[email protected]
6363
with:
64-
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
64+
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
6565
build-requirements: 'setuptools cython setuptools_scm'
6666
- name: Build and publish wheel
6767
env:
@@ -79,7 +79,7 @@ jobs:
7979
- name: Set up Python
8080
uses: actions/setup-python@v5
8181
with:
82-
python-version: 3.10
82+
python-version: 3.11
8383
- name: Set up QEMU
8484
id: qemu
8585
uses: docker/setup-qemu-action@v3
@@ -90,7 +90,7 @@ jobs:
9090
- name: Python wheels manylinux build
9191
uses: RalfG/[email protected]_aarch64
9292
with:
93-
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
93+
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
9494
build-requirements: 'setuptools cython setuptools_scm'
9595
- name: Build and publish wheel
9696
env:
@@ -106,7 +106,7 @@ jobs:
106106
- name: Set up Python
107107
uses: actions/setup-python@v5
108108
with:
109-
python-version: '3.10'
109+
python-version: '3.11'
110110
- name: Install dependencies
111111
run: |
112112
python -m pip install --upgrade pip

vpython/test/test_namespace.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ def test_names_in_base_namspace():
177177
for name in ['cbrt', 'exp2']:
178178
api_name_set.add(name)
179179

180+
# Python 3.12 adds one more new math function.
181+
if python_version.major == 3 and python_version.minor >= 12:
182+
for name in ['sumprod']:
183+
api_name_set.add(name)
184+
180185
print(sorted(api_name_set - current_names))
181186

182187
# We may have added new names, so start with this weaker test

0 commit comments

Comments
 (0)