diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index b66179bf9..ee61504eb 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -15,12 +15,15 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v3 with: - python-version: '3.10' - channels: conda-forge,defaults - channel-priority: true - - name: Install llvm on Macos + fetch-depth: 0 # Ensure tags are fetched for versioning + - uses: actions/setup-python@v5 + with: + python-version: | + 3.10 + 3.11 + 3.12 + - name: Install llvm on MacOS if: startsWith(matrix.os, 'macos') shell: bash -l {0} env: diff --git a/build_utils/release_tox.ini b/build_utils/release_tox.ini index 5c8a300a7..0ed260e2b 100644 --- a/build_utils/release_tox.ini +++ b/build_utils/release_tox.ini @@ -1,74 +1,52 @@ [tox] # Use conda to set up the python environments to run in -requires = tox-conda +requires = tox>=4 # The python environments to run the tests in envlist = pypi-py310-min,conda-py310-old-np,{pypi,conda}-{py310,py311,py312},pypisource-{py310,py312} -# Skip the execution of setup.py as we do it with the correct version in commands_pre below -skipsdist = True +skip_install = True [testenv] changedir = tests_and_analysis/test test_command = python {toxinidir}/../tests_and_analysis/test/run_tests.py --report requirements_dir = {toxinidir}/../tests_and_analysis +passenv = + EUPHONIC_VERSION +# The name "extras" is reserved and has its own format with newlines: +# we need a token to inject into custom commands_pre, so call it extras_str +extras_str = [test,matplotlib,phonopy-reader,brille] # Test PyPI source distribution [testenv:pypisource-{py310,py312}] -passenv = CC CC_LD LDFLAGS CPPFLAGS -install_command = python -m pip install {opts} {packages} -deps = - numpy - spglib # Not interested here in whether source builds of spglib work - -r{[testenv]requirements_dir}/tox_requirements.txt +passenv = + CC + CC_LD + LDFLAGS + CPPFLAGS commands_pre = python -m pip install \ --force-reinstall \ - 'euphonic[matplotlib,phonopy_reader,brille]=={env:EUPHONIC_VERSION}' \ + euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} \ --no-binary 'euphonic' commands = {[testenv]test_command} - [testenv:pypi-{py310,py311,py312}] -install_command = python -m pip install {opts} {packages} -deps = - numpy - -r{[testenv]requirements_dir}/tox_requirements.txt commands_pre = python -m pip install \ --force-reinstall \ - 'euphonic[matplotlib,phonopy_reader,brille]=={env:EUPHONIC_VERSION}' \ + euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} \ --only-binary 'euphonic' commands = {[testenv]test_command} -[testenv:pypi-py310-min-win-linux] -install_command = python -m pip install --force-reinstall {opts} {packages} -platform = - linux: linux - windows: win32 +[testenv:pypi-py310-min] +platform = (linux)|(win32) deps = - numpy==1.24.0 + numpy==1.24 + -r{toxinidir}/../tests_and_analysis/tox_requirements.txt commands_pre = python -m pip install --force-reinstall \ - -r{[testenv]requirements_dir}/minimum_euphonic_requirements.txt - python -m pip install --force-reinstall \ - -r{[testenv]requirements_dir}/tox_requirements.txt + -r{toxinidir}/../tests_and_analysis/minimum_euphonic_requirements.txt python -m pip install \ - 'euphonic[matplotlib,phonopy_reader,brille]=={env:EUPHONIC_VERSION}' \ - --only-binary 'euphonic' -commands = {[testenv]test_command} - -[testenv:pypi-py310-min-mac] -install_command = python -m pip install --force-reinstall {opts} {packages} -platform = - mac: darwin -deps = - numpy==1.24.0 -commands_pre = - python -m pip install --force-reinstall \ - -r{[testenv]requirements_dir}/minimum_euphonic_requirements_mac.txt - python -m pip install --force-reinstall \ - -r{[testenv]requirements_dir}/tox_requirements.txt - python -m pip install \ - 'euphonic[matplotlib,phonopy_reader,brille]=={env:EUPHONIC_VERSION}' \ + euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} \ --only-binary 'euphonic' commands = {[testenv]test_command} @@ -78,10 +56,13 @@ install_command = conda install {packages} conda_channels = conda-forge default -conda_deps = - --file={[testenv]requirements_dir}/tox_requirements.txt +extras = + test + matplotlib + phonopy-reader + commands_pre = - conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} matplotlib-base pyyaml h5py + conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} # Brille not available on conda commands = {[testenv]test_command} -m "not brille" @@ -93,10 +74,12 @@ install_command = conda install {packages} conda_channels = conda-forge default -conda_deps = - --file={[testenv]requirements_dir}/tox_requirements.txt +deps = numpy==1.24 +extras = + test + matplotlib + phonopy-reader commands_pre = - conda install numpy=1.22 - conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} matplotlib-base pyyaml h5py + conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} # Brille not available on conda commands = {[testenv]test_command} -m "not brille"