-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor workflow to install from build configuration and use `pytest…
…` and `tox` (#218) * refactor workflow to install from build configuration and use `pytest` * branch filter * use `tox` * add coverage * remove schedule * ignore lint rule * add `xdist` to env list * don't fail-fast checks * add `long_description` * add `build-backend` to use PEP517 build
- Loading branch information
1 parent
d4e1c66
commit 78cca9f
Showing
5 changed files
with
128 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ requires = [ | |
"wheel", | ||
"oldest-supported-numpy", | ||
] | ||
build-backend = 'setuptools.build_meta' |
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 |
---|---|---|
|
@@ -39,14 +39,14 @@ def c_includes(parent, depth=1): | |
'astropy>=5.0.4', | ||
'numpy', | ||
'scipy', | ||
'stsci.tools', | ||
'stsci.tools>=4.0.0', | ||
], | ||
extras_require={ | ||
'docs': [ | ||
'sphinx', | ||
], | ||
'test': [ | ||
'ci_watson', | ||
'ci-watson', | ||
'pytest', | ||
'pytest-cov', | ||
'codecov', | ||
|
@@ -74,6 +74,8 @@ def c_includes(parent, depth=1): | |
author='Phil Hodge, Robert Jedrzejewski', | ||
author_email='[email protected]', | ||
description='Calibration software for COS (Cosmic Origins Spectrograph)', | ||
long_description='README.md', | ||
long_description_content_type='text/x-rst', | ||
url='https://github.com/spacetelescope/calcos', | ||
license='BSD', | ||
classifiers=[ | ||
|
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,77 @@ | ||
[tox] | ||
envlist = | ||
check-{style,build} | ||
test{,-pyargs,-warnings,-regtests,-cov}-xdist | ||
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 --select=E9,F63,F7,F82 --show-source --statistics {posargs} | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics {posargs} | ||
|
||
[testenv:check-build] | ||
description = check build sdist/wheel and a strict twine check for metadata | ||
skip_install = true | ||
deps = | ||
build | ||
twine>=3.3 | ||
commands = | ||
python -m build . | ||
twine check --strict dist/* | ||
|
||
[testenv] | ||
description = | ||
run tests | ||
warnings: treating warnings as errors | ||
regtests: with --bigdata and --slow flags | ||
cov: with coverage | ||
xdist: using parallel processing | ||
passenv = | ||
HOME | ||
CRDS_* | ||
CODECOV_* | ||
TEST_BIGDATA | ||
lref | ||
extras = | ||
test | ||
deps = | ||
cov: pytest-cov | ||
xdist: pytest-xdist | ||
commands_pre = | ||
pip freeze | ||
commands = | ||
pytest --slow \ | ||
regtests: --bigdata \ | ||
cov: --cov --cov-report=xml \ | ||
warnings: -W error \ | ||
xdist: -n auto \ | ||
{posargs} | ||
|
||
[testenv:build-docs] | ||
description = invoke sphinx-build to build the HTML docs | ||
skip_install = true | ||
extras = | ||
docs | ||
commands = | ||
sphinx-build -W docs/source docs/_build | ||
|
||
[testenv:build-dist] | ||
description = build wheel and sdist | ||
skip_install = true | ||
deps = | ||
build | ||
commands = | ||
python -m build . |