Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tox 4 for release testing #333

Merged
merged 6 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
70 changes: 25 additions & 45 deletions build_utils/release_tox.ini
Original file line number Diff line number Diff line change
@@ -1,74 +1,49 @@
[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
CC_LD
ajjackson marked this conversation as resolved.
Show resolved Hide resolved
setenv =
EXTRAS=[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{env:EXTRAS}=={env:EUPHONIC_VERSION}' \
ajjackson marked this conversation as resolved.
Show resolved Hide resolved
--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{env:EXTRAS}=={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
deps =
numpy==1.24.0
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
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
numpy==1.21.3
ajjackson marked this conversation as resolved.
Show resolved Hide resolved
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
-r{toxinidir}/tests_and_analysis/minimum_euphonic_requirements.txt
python -m pip install \
'euphonic[matplotlib,phonopy_reader,brille]=={env:EUPHONIC_VERSION}' \
'euphonic{env:EXTRAS}=={env:EUPHONIC_VERSION}' \
ajjackson marked this conversation as resolved.
Show resolved Hide resolved
--only-binary 'euphonic'
commands = {[testenv]test_command}

Expand All @@ -78,10 +53,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"

Expand All @@ -93,10 +71,12 @@ install_command = conda install {packages}
conda_channels =
conda-forge
default
conda_deps =
--file={[testenv]requirements_dir}/tox_requirements.txt
deps = numpy==1.22
ajjackson marked this conversation as resolved.
Show resolved Hide resolved
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"
Loading