-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor CI and use
tox.ini
with Tox 4 and PEP517 build (#108)
* refactor CI and use `tox.ini` with TOx 4 and PEP517 build * add `long_description_content_type` to satisfy metadata check * ignore directories in pytest discovery * remove `src` from `testpaths` * add change log entry * set CRDS path
- Loading branch information
1 parent
655677c
commit 1e90078
Showing
4 changed files
with
121 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[tox] | ||
envlist = | ||
check-{style,security,build} | ||
test{,-jwst}-xdist{,-cov} | ||
build-{docs,dist} | ||
|
||
# tox environments are constructed with so-called 'factors' (or terms) | ||
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: | ||
# will only take effect if that factor is included in the environment name. To | ||
# see a list of example environments that can be run, along with a description, | ||
# run: | ||
# | ||
# tox -l -v | ||
# | ||
|
||
[testenv:check-style] | ||
description = check code style, e.g. with flake8 | ||
skip_install = true | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 --count src tests {posargs} | ||
|
||
[testenv:check-security] | ||
description = run bandit to check security compliance | ||
skip_install = true | ||
deps = | ||
bandit>=1.7 | ||
commands = | ||
bandit -r -ll src | ||
|
||
[testenv:check-build] | ||
description = check build sdist/wheel and a strict twine check for metadata | ||
skip_install = true | ||
deps = | ||
twine>=3.3 | ||
build | ||
commands = | ||
python -m build . | ||
twine check --strict dist/* | ||
|
||
[testenv] | ||
description = | ||
run tests | ||
xdist: using parallel processing | ||
cov: with coverage | ||
pass_env = | ||
jwst: CRDS_* | ||
set_env = | ||
jwst: CRDS_CLIENT_RETRY_COUNT=3 | ||
jwst: CRDS_CLIENT_RETRY_DELAY_SECONDS=20 | ||
jwst: CRDS_SERVER_URL=https://jwst-crds.stsci.edu | ||
extras = | ||
test | ||
deps = | ||
xdist: pytest-xdist | ||
cov: pytest-cov | ||
jwst: jwst[test] @ git+https://github.com/spacetelescope/jwst | ||
commands_pre = | ||
pip freeze | ||
commands = | ||
pytest \ | ||
xdist: -n auto \ | ||
cov: --cov=. --cov-config=setup.cfg --cov-report=term-missing --cov-report=xml \ | ||
jwst: --pyargs jwst.datamodels \ | ||
{posargs} | ||
|
||
[testenv:build-docs] | ||
description = invoke sphinx-build to build the HTML docs | ||
extras = docs | ||
commands = | ||
sphinx-build -W docs docs/_build | ||
|
||
[testenv:build-dist] | ||
description = build wheel and sdist | ||
skip_install = true | ||
deps = | ||
build | ||
commands = | ||
python -m build . |