diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 332957f..4af28bc 100644 --- a/.github/workflows/build.yml +++ b/.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: @@ -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: @@ -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 @@ -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" && \ 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 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