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 19, 2024
1 parent 59ddb0c commit 0db83f7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 38 deletions.
59 changes: 22 additions & 37 deletions build_utils/release_tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
2 changes: 1 addition & 1 deletion tests_and_analysis/minimum_euphonic_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy==1.24.0
scipy==1.10.0
spglib==1.9.4.2
spglib==2.1
seekpath==1.1.0
pint==0.22
matplotlib==3.8
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ 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
spglib==2.1
extras =
{[testenv]extras}
matplotlib
Expand Down

0 comments on commit 0db83f7

Please sign in to comment.