From 6829e75dc3a8885ab9c9b8a425178ffef2f4273c Mon Sep 17 00:00:00 2001 From: Rebecca Fair Date: Tue, 14 Feb 2023 13:34:32 +0000 Subject: [PATCH] Test/release on Python 3.11 (#251) * Test/release on Python 3.11 * Update changelog * Update cibuildwheel Required for 3.11 support --- .github/workflows/build_upload_pypi_wheels.yml | 11 +++++++---- .github/workflows/run_tests.yml | 4 ++-- CHANGELOG.rst | 5 +++++ release_tox.ini | 10 +++++----- tox.ini | 4 ++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_upload_pypi_wheels.yml b/.github/workflows/build_upload_pypi_wheels.yml index 7bf97caa6..3002753c3 100644 --- a/.github/workflows/build_upload_pypi_wheels.yml +++ b/.github/workflows/build_upload_pypi_wheels.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [windows-latest, macos-latest, ubuntu-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] include: - os: windows-latest wheelname: win @@ -31,6 +31,9 @@ jobs: - python-version: 3.10 manylinux-version-tag: cp310 numpy-version: 1.21.3 + - python-version: 3.11 + manylinux-version-tag: cp311 + numpy-version: 1.23.2 fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -61,7 +64,7 @@ jobs: - name: Build manylinux Python wheel if: matrix.os == 'ubuntu-latest' - uses: pypa/cibuildwheel@v2.8.0 + uses: pypa/cibuildwheel@v2.12.0 env: CIBW_BUILD: ${{ matrix.manylinux-version-tag}}-manylinux* CIBW_BEFORE_BUILD: python -mpip install numpy==${{ matrix.numpy-version }} @@ -70,7 +73,7 @@ jobs: output-dir: wheelhouse - name: Create source distribution - if: matrix.os == 'windows-latest' && matrix.python-version == '3.10' + if: matrix.os == 'windows-latest' && matrix.python-version == '3.11' shell: bash -l {0} run: | python setup.py sdist @@ -81,7 +84,7 @@ jobs: name: wheels path: wheelhouse/*-${{ matrix.wheelname }}*.whl - name: Upload source dist to PyPI - if: github.event_name == 'release' && matrix.os == 'windows-latest' && matrix.python-version == '3.10' + if: github.event_name == 'release' && matrix.os == 'windows-latest' && matrix.python-version == '3.11' shell: bash -l {0} env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index bf03881ca..4596fba25 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -33,10 +33,10 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r tests_and_analysis/ci_requirements.txt - - name: Run tests, skip Python 3.8, 3.9 unless workflow dispatch + - name: Run tests, skip Python 3.8, 3.9, 3.10 unless workflow dispatch if: github.event_name != 'workflow_dispatch' env: - TOX_SKIP_ENV: '.*?(py38|py39).*?' + TOX_SKIP_ENV: '.*?(py38|py39|py310).*?' shell: bash -l {0} run: python -m tox - name: Run tests, workflow dispatch so test all Python versions diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bbadae1b4..1eb84e087 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ `Unreleased `_ ---------- +- Improvements: + + - Euphonic now tests on Python 3.11 + - Euphonic now provides PyPI wheels for Python 3.11 + - New features: - You can now perform linear interpolation of phonon frequencies and diff --git a/release_tox.ini b/release_tox.ini index 0a46a55e3..c50f7ea65 100644 --- a/release_tox.ini +++ b/release_tox.ini @@ -2,7 +2,7 @@ # Use conda to set up the python environments to run in requires = tox-conda # The python environments to run the tests in -envlist = pypi-py37-min,pypi-py37,conda-py38-old-np,{pypi,conda}-{py38,py39,py310},pypisource-{py37,py310} +envlist = pypi-py37-min,pypi-py37,conda-py38-old-np,{pypi,conda}-{py38,py39,py310,py311},pypisource-{py37,py311} # Skip the execution of setup.py as we do it with the correct version in commands_pre below skipsdist = True @@ -11,7 +11,7 @@ changedir = tests_and_analysis/test test_command = python run_tests.py --report # Test PyPI source distribution -[testenv:pypisource-{py37,py310}] +[testenv:pypisource-{py37,py311}] install_command = python -m pip install {opts} {packages} deps = numpy @@ -24,7 +24,7 @@ commands_pre = commands = {[testenv]test_command} -[testenv:pypi-{py37,py38,py39,py310}] +[testenv:pypi-{py37,py38,py39,py310,py311}] install_command = python -m pip install {opts} {packages} deps = numpy @@ -50,7 +50,7 @@ commands_pre = --only-binary 'euphonic' commands = {[testenv]test_command} -[testenv:conda-{py38,py39,py310}] +[testenv:conda-{py38,py39,py310,py311}] whitelist_externals = conda install_command = conda install {packages} conda_channels = @@ -77,4 +77,4 @@ commands_pre = conda install numpy=1.20 conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} matplotlib-base pyyaml h5py # Brille not available on conda -commands = {[testenv]test_command} -m "not brille" \ No newline at end of file +commands = {[testenv]test_command} -m "not brille" diff --git a/tox.ini b/tox.ini index 69951add3..11400dc0b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] requires = tox-conda # The python environments to run the tests in -envlist = py38,py39,py310,py37-{base,matplotlib,phonopy_reader,brille,all},py37-minrequirements-linux +envlist = py38,py39,py310,py311,py37-{base,matplotlib,phonopy_reader,brille,all},py37-minrequirements-linux # Skip the execution of setup.py as we do it with the correct arg in commands_pre below skipsdist = True @@ -9,7 +9,7 @@ skipsdist = True changedir = tests_and_analysis/test test_command = python run_tests.py --report -[testenv:{py38,py39,py310}] +[testenv:{py38,py39,py310,py311}] install_command = python -m pip install \ --force-reinstall \