-
Notifications
You must be signed in to change notification settings - Fork 32
/
tox.ini
114 lines (107 loc) · 3.45 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[tox]
envlist =
check-{style,build,types}
test{,-warnings,-cov}-xdist
test-{jwst,romancal}{,-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-types]
description = check type hints, e.g. with mypy
deps =
mypy
types-requests
commands =
mypy src/stcal --config-file pyproject.toml
[testenv:check-style]
description = check code style, e.g. with ruff
skip_install = true
deps =
pre-commit
commands =
pre-commit install-hooks
pre-commit run --color always --all-files --show-diff-on-failure {posargs}
[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
oldestdeps: with the oldest supported version of key dependencies
warnings: treating warnings as errors
cov: with coverage
xdist: using parallel processing
change_dir =
jwst,romancal: {env_tmp_dir}
extras =
test
allowlist_externals =
git
jwst,romancal: bash
deps =
xdist: pytest-xdist
oldestdeps: minimum_dependencies
devdeps: numpy>=0.0.dev0
devdeps: scipy>=0.0.dev0
devdeps: scikit-image>=0.0.dev0
devdeps: pyerfa>=0.0.dev0
devdeps: astropy>=0.0.dev0
devdeps: requests>=0.0.dev0
devdeps: tweakwcs @ git+https://github.com/spacetelescope/tweakwcs.git
devdeps: asdf @ git+https://github.com/asdf-format/asdf.git
devdeps: drizzle @ git+https://github.com/spacetelescope/drizzle.git
devdeps: gwcs @ git+https://github.com/spacetelescope/gwcs.git
use_develop = true
pass_env =
CI
romancal: WEBBPSF_PATH
set_env =
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
romancal: CRDS_SERVER_URL = https://roman-crds.stsci.edu
jwst: CRDS_SERVER_URL = https://jwst-crds.stsci.edu
jwst,romancal: CRDS_PATH = {package_root}/crds_cache
jwst,romancal: CRDS_CLIENT_RETRY_COUNT = 3
jwst,romancal: CRDS_CLIENT_RETRY_DELAY_SECONDS = 20
commands_pre =
oldestdeps: minimum_dependencies stcal --filename requirements-min.txt
oldestdeps: pip install -r requirements-min.txt
jwst,romancal: bash -c "pip freeze -q | grep 'stcal @' > {env_tmp_dir}/requirements.txt"
jwst: git clone https://github.com/spacetelescope/jwst.git
romancal: git clone https://github.com/spacetelescope/romancal.git
jwst: pip install -e jwst[test]
romancal: pip install -e romancal[test]
jwst,romancal: pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest \
warnings: -W error \
xdist: -n auto \
jwst: jwst \
romancal: romancal \
cov: --cov={package_root} --cov-config={package_root}/pyproject.toml --cov-report=term-missing --cov-report=xml \
{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 .