From 537ce839f1309b92c9cb7741751cc6ba8d921834 Mon Sep 17 00:00:00 2001 From: Jacob Wilkins Date: Wed, 18 Dec 2024 21:40:41 +0000 Subject: [PATCH] Update release tox to use constraints and restructure for ease of split --- build_utils/release_tox.ini | 59 ++++++++++++++----------------------- tox.ini | 2 ++ 2 files changed, 24 insertions(+), 37 deletions(-) diff --git a/build_utils/release_tox.ini b/build_utils/release_tox.ini index 0ed260e2b..e49e9b593 100644 --- a/build_utils/release_tox.ini +++ b/build_utils/release_tox.ini @@ -15,42 +15,37 @@ passenv = # we need a token to inject into custom commands_pre, so call it extras_str extras_str = [test,matplotlib,phonopy-reader,brille] + +[pypi] +inst_str = + python -m pip install euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} +commands = {[testenv]test_command} + # Test PyPI source distribution [testenv:pypisource-{py310,py312}] +base = pypi passenv = CC CC_LD LDFLAGS CPPFLAGS -commands_pre = - python -m pip install \ - --force-reinstall \ - euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} \ - --no-binary 'euphonic' -commands = {[testenv]test_command} +commands_pre = {[pypi]inst_str} --no-binary "euphonic" [testenv:pypi-{py310,py311,py312}] -commands_pre = - python -m pip install \ - --force-reinstall \ - euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} \ - --only-binary 'euphonic' -commands = {[testenv]test_command} +base = pypi +commands_pre = {[pypi]inst_str} --only-binary "euphonic" [testenv:pypi-py310-min] +base = pypi platform = (linux)|(win32) deps = numpy==1.24 - -r{toxinidir}/../tests_and_analysis/tox_requirements.txt commands_pre = - python -m pip install --force-reinstall \ - -r{toxinidir}/../tests_and_analysis/minimum_euphonic_requirements.txt - python -m pip install \ - euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} \ - --only-binary 'euphonic' -commands = {[testenv]test_command} + {[pypi]inst_str} -c {toxinidir}/../tests_and_analysis/minimum_euphonic_requirements.txt \ + --only-binary "euphonic" -[testenv:conda-{py310,py311,py312}] + +[conda] whitelist_externals = conda install_command = conda install {packages} conda_channels = @@ -60,26 +55,16 @@ extras = test matplotlib phonopy-reader - -commands_pre = - conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} +commands_pre = conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} # Brille not available on conda commands = {[testenv]test_command} -m "not brille" +[testenv:conda-{py310,py311,py312}] +base = conda + # Test against a version of Numpy less than the latest for Conda # See https://github.com/conda-forge/euphonic-feedstock/pull/20 [testenv:conda-py310-old-np] -whitelist_externals = conda -install_command = conda install {packages} -conda_channels = - conda-forge - default -deps = numpy==1.24 -extras = - test - matplotlib - phonopy-reader -commands_pre = - conda install -c conda-forge euphonic={env:EUPHONIC_VERSION} -# Brille not available on conda -commands = {[testenv]test_command} -m "not brille" +base = conda +deps = + numpy==1.24 diff --git a/tox.ini b/tox.ini index 63a295682..d9aa51762 100644 --- a/tox.ini +++ b/tox.ini @@ -77,6 +77,8 @@ commands = {[testenv]test_command} -m "not c_extension" set_env = linux: PIP_CONSTRAINT={toxinidir}/tests_and_analysis/minimum_euphonic_requirements.txt mac: PIP_CONSTRAINT={toxinidir}/tests_and_analysis/minimum_euphonic_requirements_mac.txt +deps = + numpy==1.24 extras = {[testenv]extras} matplotlib