diff --git a/build_utils/pypi_release_tox.ini b/build_utils/pypi_release_tox.ini index 8b340edf1..a7313c9b4 100644 --- a/build_utils/pypi_release_tox.ini +++ b/build_utils/pypi_release_tox.ini @@ -7,13 +7,14 @@ 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] +inst_str = + python -m pip install euphonic{[testenv]extras_str}=={env:EUPHONIC_VERSION} +commands = python {toxinidir}/../tests_and_analysis/test/run_tests.py --report # Test PyPI source distribution [testenv:source-{py310,py312}] @@ -22,30 +23,14 @@ passenv = 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 = {[testenv]inst_str} --no-binary 'euphonic' [testenv:{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} +commands_pre = {[testenv]inst_str} --only-binary 'euphonic' [testenv:py310-min] 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} + setuptools==60.* +commands_pre = {[testenv]inst_str} -c {toxinidir}/../tests_and_analysis/minimum_euphonic_requirements.txt --only-binary 'euphonic' diff --git a/tox.ini b/tox.ini index 9a168e3a5..9e9798c6a 100644 --- a/tox.ini +++ b/tox.ini @@ -61,7 +61,7 @@ extras = phonopy-reader brille commands = - {[testenv]test_command} --cov -m multiple_extras + {[testenv]test_command} --cov -m "multiple_extras" [testenv:py310-no-c] install_command = {[testenv]install_command} -Csetup-args="-Dpython_only=true" @@ -71,42 +71,21 @@ extras = matplotlib phonopy-reader brille -commands = {[testenv]test_command} -m 'not c_extension' +commands = {[testenv]test_command} -m "not c_extension" -[testenv:py310-minrequirements-linux] -skip_install = True -allowlist_externals = rm -install_command = - python -m pip install --force-reinstall {opts} {packages} -platform = linux -deps = - numpy==1.24.0 - -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 --force-reinstall \ - -r{toxinidir}/tests_and_analysis/tox_requirements.txt - # Force rebuild of euphonic extension to avoid Numpy clash - rm -rf {toxinidir}/build - python -m pip install '{toxinidir}[matplotlib,phonopy-reader,brille]' -commands = {[testenv]test_command} - -[testenv:py310-minrequirements-mac] -skip_install = True -allowlist_externals = rm -install_command = - python -m pip install --force-reinstall {opts} {packages} -platform = darwin +[testenv:py310-minrequirements-{linux,mac}] +platform = + linux: linux + mac: darwin +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.0 - -r{toxinidir}/tests_and_analysis/tox_requirements.txt -commands_pre = - python -m pip install --force-reinstall \ - -r{toxinidir}/tests_and_analysis/minimum_euphonic_requirements_mac.txt - python -m pip install --force-reinstall \ - -r{toxinidir}/tests_and_analysis/tox_requirements.txt - # Force rebuild of euphonic extension to avoid Numpy clash - rm -rf {toxinidir}/build - python -m pip install '{toxinidir}[matplotlib,phonopy-reader,brille]' -commands = {[testenv]test_command} + numpy==1.24 + setuptools==60.* +extras = + {[testenv]extras} + matplotlib + phonopy-reader + brille +commands = {[testenv]test_command} -m "multiple_extras"