Skip to content

Commit

Permalink
add tox configutation (#2829)
Browse files Browse the repository at this point in the history
Now, one can execute `tox` to test the Python package in an isolated
environment. (The required packages can be automatically installed)

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz authored Sep 18, 2023
1 parent c92d1f1 commit 0b46563
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,31 @@ test-command = [
"dp -h",
]

# One can run `tox` or `tox -e gpu`
# to run pytest in an isolated environment
# Use with pipx:
# $ pip install -U pipx
# $ pipx tox
[tool.tox]
legacy_tox_ini = """
[tox]
min_version = 4.0
[testenv]
extras =
test
cpu
commands = pytest source/tests
[testenv:gpu]
extras =
test
gpu
commands = pytest source/tests
setenv =
DP_VARIANT = cuda
"""

# selectively turn of lintner warnings, always include reasoning why any warning should
# be silenced

Expand Down

0 comments on commit 0b46563

Please sign in to comment.