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

Add tox testing #27

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Add tox testing #27

merged 1 commit into from
Feb 13, 2024

Conversation

ElliottKasoar
Copy link
Member

Resolves #26

We may want to wait to see how @federicazanca has implemented tox for aiida-mlip, but this seems to work as expected e.g. using tox run -e ALL.

To address the questions in stfc/aiida-mlip#59, I think the default tox run will only run the pytest section with Python 3.10, but, using -e, all tests, including the range of Python versions listed, can be tested individually/together.

Note: with the current set up (poetry install --no-root --sync)

tox will create an sdist package of the project and uses pip to install it in a fresh environment. Thus, dependencies are resolved by pip in the first place. But afterwards we run Poetry, which will install the locked dependencies into the environment.

There are a couple of alternatives, including allowing tox to install everything, or running poetry install --with dev etc. with skip_install = true, in which case:

tox will not do any install. Poetry installs all the dependencies and the current package in editable mode. Thus, tests are running against the local files and not the built and installed package.

(See https://python-poetry.org/docs/faq#is-tox-supported)

This might be worth looking into this more in aiida-mlip @federicazanca, as we have more dependencies already set up to test.

Also note we already have

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

in pyproject.toml, so tox is able to build the package using poetry as expected, and isolated_build is now always used, so this does not need to be added.

@alinelena alinelena merged commit c712bbc into main Feb 13, 2024
13 checks passed
@ElliottKasoar ElliottKasoar deleted the add-tox branch February 13, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tox testing
2 participants