Skip to content

Commit

Permalink
Merge pull request #258 from mwcraig/update-build-matrix-pt312
Browse files Browse the repository at this point in the history
Update build matrix for Python 3.12
  • Loading branch information
mwcraig committed Jan 30, 2024
2 parents 0e51b2f + 5aa8ddc commit c1462ba
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/build.yml
@@ -1,6 +1,16 @@
name: Test/build

on: [push, pull_request]
on:
workflow_dispatch: # Allows manual triggering
push: # only build on pusheess to the main branch
branches:
- master
pull_request:

# Stop current actions if there is a new push to the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -9,8 +19,18 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
python-version: [3.11, 3.12]
platform: [ubuntu-latest, macos-latest, windows-latest]
# The include below adds jobs on older versions of python,
# but just on one platform. Windows is probably the most widely
# used for vpython, so test on that.
include:
- python-version: "3.8"
platform: windows-latest
- python-version: "3.9"
platform: windows-latest
- python-version: "3.10"
platform: windows-latest
runs-on: ${{ matrix.platform }}

steps:
Expand Down Expand Up @@ -62,7 +82,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311]
python-version: [cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
runs-on: ubuntu-latest
env:
py: /opt/python/${{ matrix.python-version }}/bin/python
Expand All @@ -84,9 +104,9 @@ jobs:
source .env/bin/activate && \
echo -e "\e[1;34m Install dependencies \e[0m" && \
python -m pip install --upgrade pip && \
pip install pytest Cython wheel && \
pip install pytest Cython wheel build && \
echo -e "\e[1;34m Build wheel \e[0m" && \
python setup.py bdist_wheel && \
python -m build && \
echo -e "\e[1;34m Install vpython \e[0m" && \
pip install . && \
echo -e "\e[1;34m Run tests \e[0m" && \
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/upload_pypi.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
platform: [macos-latest, windows-latest] # Wheels on linux below
runs-on: ${{ matrix.platform }}

Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: 3.11
- name: Stable with rustfmt and clippy
uses: actions-rs/toolchain@v1
with:
Expand All @@ -61,7 +61,7 @@ jobs:
- name: Python wheels manylinux build
uses: RalfG/python-wheels-manylinux-build@v0.7.1
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'setuptools cython setuptools_scm'
- name: Build and publish wheel
env:
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: 3.11
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Python wheels manylinux build
uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_aarch64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'setuptools cython setuptools_scm'
- name: Build and publish wheel
env:
Expand All @@ -106,7 +106,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
5 changes: 5 additions & 0 deletions vpython/test/test_namespace.py
Expand Up @@ -177,6 +177,11 @@ def test_names_in_base_namspace():
for name in ['cbrt', 'exp2']:
api_name_set.add(name)

# Python 3.12 adds one more new math function.
if python_version.major == 3 and python_version.minor >= 12:
for name in ['sumprod']:
api_name_set.add(name)

print(sorted(api_name_set - current_names))

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

0 comments on commit c1462ba

Please sign in to comment.