From 4b69a9a360285d058022adc08a79504b8b150b15 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:06:06 -0600 Subject: [PATCH 1/7] Update build matrix for Python 3.12 --- .github/workflows/build.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 332957f..4e36bb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,11 @@ 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: jobs: build: @@ -9,8 +14,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: From a08dfdf64a152d452e1731004adfa99741da918b Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:08:14 -0600 Subject: [PATCH 2/7] Update aarch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e36bb3..bbb907a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311] + python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312] runs-on: ubuntu-latest env: py: /opt/python/${{ matrix.python-version }}/bin/python From 99d13ac2f1840606e0ccd34d5d0386e6d1cd453f Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:08:28 -0600 Subject: [PATCH 3/7] Stop current actions on push to same branch --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbb907a..0ab03d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,11 @@ on: - 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: From f7912973e1cd393f6e79720d57ca56218db41f89 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:09:24 -0600 Subject: [PATCH 4/7] Drop 3.7 from aarch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ab03d3..d772b62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312] + 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 From b9f4333c3fc023413bdd97a1a32751a7da0ecb85 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:11:19 -0600 Subject: [PATCH 5/7] Add new function in math namspace in Python 3.12 --- vpython/test/test_namespace.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vpython/test/test_namespace.py b/vpython/test/test_namespace.py index 619a265..8287cd9 100644 --- a/vpython/test/test_namespace.py +++ b/vpython/test/test_namespace.py @@ -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 From f3d4e00587c351f229c458e4fec5d3a6848554f6 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:17:25 -0600 Subject: [PATCH 6/7] Fix outdated build command in aarch builds --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d772b62..4af28bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,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" && \ From 5aa8ddc8f320ea8e283ff94c04f384965d9b02fa Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 30 Jan 2024 09:40:21 -0600 Subject: [PATCH 7/7] Update pypi uploader action --- .github/workflows/upload_pypi.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index 273584e..debbea2 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -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 }} @@ -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: @@ -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: @@ -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 @@ -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: @@ -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