Skip to content

Commit

Permalink
Fix tox and nix configs so all tox tests execute correctly (#2992)
Browse files Browse the repository at this point in the history
Closes #2907

`tox -e docs` was failing due to missing env vars in tox.ini config
`tox -e khmer_master` fails to due to external errors now, it was
missing the URL for installing latest version from github.

Also limit test discovery in `hypothesis`, `khmer`, and `khmer_master`
to `doc tests`, avoiding going into `.tox` and other internal
directories containing python code.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
luizirber and pre-commit-ci[bot] committed Feb 11, 2024
1 parent 550e2aa commit ec898ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@

# workaround for https://github.com/NixOS/nixpkgs/blob/48dfc9fa97d762bce28cc8372a2dd3805d14c633/doc/languages-frameworks/python.section.md#python-setuppy-bdist_wheel-cannot-create-whl
SOURCE_DATE_EPOCH = 315532800; # 1980

# exporting to fix doc building errors in sphinx
LC_ALL="C.utf8";
});
});
}
13 changes: 8 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ commands =
--run-hypothesis \
--hypothesis-show-statistics \
--hypothesis-profile ci \
{posargs:.}
{posargs:doc tests}

[testenv:khmer]
basepython = python3.10
Expand All @@ -86,20 +86,20 @@ commands =
--cov-report= \
--junitxml {toxworkdir}/junit.{envname}.xml \
-k test_nodegraph \
{posargs:.}
{posargs:doc tests}

[testenv:khmer_master]
basepython = python3.10
deps =
-e
git+https://github.com/dib-lab/khmer.git\#egg
commands =
pytest \
--cov "{envsitepackagesdir}/sourmash" \
--cov-config "{toxinidir}/tox.ini" \
--cov-report= \
--junitxml {toxworkdir}/junit.{envname}.xml \
-k test_nodegraph \
{posargs:.}
{posargs:doc tests}

[testenv:asv]
description = run asv for benchmarking (compare current commit with latest)
Expand All @@ -121,7 +121,10 @@ commands =
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
allowlist_externals = pandoc
change_dir = {toxinidir}
pass_env = HOME
pass_env =
HOME
LC_ALL
LOCALE_*

[testenv:package_description]
description = check that the long description is valid
Expand Down

0 comments on commit ec898ff

Please sign in to comment.