Skip to content

Commit

Permalink
Fix tox for poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar authored and alinelena committed Feb 13, 2024
1 parent e7b21c8 commit c3684ee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.lock
*.pyc
*.swo
*.swp
Expand Down
26 changes: 1 addition & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ coverage = {extras = ["toml"], version = "^7.4.1"}
pgtest = "^1.3.2"
pytest = "^8.0"
pytest-cov = "^4.1.0"
tox = "^4.12.1"
wheel = "^0.42"

[tool.poetry.group.pre-commit]
Expand Down Expand Up @@ -102,28 +103,3 @@ line_length = 120
force_sort_within_sections = true
sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'AIIDA', 'FIRSTPARTY', 'LOCALFOLDER']
known_aiida = ['aiida']

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py39
[testenv]
usedevelop=True
[testenv:py{39,310,311,312}]
description = Run the test suite against a python version
extras = testing
commands = pytest {posargs}
[testenv:pre-commit]
description = Run the pre-commit checks
extras = pre-commit
commands = pre-commit run {posargs}
[testenv:docs]
description = Build the documentation
extras = docs
commands = sphinx-build -nW --keep-going -b html {posargs} docs/source docs/build/html
commands_post = echo "open file://{toxinidir}/docs/build/html/index.html"
"""
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
envlist = py311

[testenv]
usedevelop=True

[testenv:py{39,310,311,312}]
description = Run the test suite against Python versions
allowlist_externals = poetry
commands_pre = poetry install --no-root --sync
commands = poetry run pytest --cov aiida_mlip --import-mode importlib

[testenv:pre-commit]
description = Run the pre-commit checks
allowlist_externals = poetry
commands_pre = poetry install --no-root --sync
commands = poetry run pre-commit run {posargs} --all-files

[testenv:docs]
description = Build the documentation
allowlist_externals = poetry, echo
commands_pre = poetry install --no-root --sync
commands = poetry run sphinx-build -nW --keep-going -b html {posargs} docs/source docs/build/html
commands_post = echo "open file://{toxinidir}/docs/build/html/index.html"

0 comments on commit c3684ee

Please sign in to comment.