Skip to content

Commit

Permalink
Update release tox to use constraints and restructure for ease of split
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Dec 20, 2024
1 parent b24953d commit 77c74aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
31 changes: 9 additions & 22 deletions build_utils/pypi_release_tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}]
Expand All @@ -22,30 +23,16 @@ 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 = {[pypi]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 = {[pypi]inst_str} --only-binary 'euphonic'

[testenv:py310-min]
platform = (linux)|(win32)
set_env =
PIP_CONSTRAINT={toxinidir}/tests_and_analysis/minimum_euphonic_requirements.txt
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 = {[pypi]inst_str} --only-binary 'euphonic'
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ extras =
commands = {[testenv]test_command} -m "not c_extension"

[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
setuptools==60.*
extras =
{[testenv]extras}
matplotlib
Expand Down

0 comments on commit 77c74aa

Please sign in to comment.