-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use Tox and OpenAstronomy test workflow
- Loading branch information
1 parent
9547509
commit 0c40b0d
Showing
3 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- '*x' | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 | ||
with: | ||
envs: | | ||
- linux: py39-xdist | ||
- linux: py310-xdist | ||
- linux: py311-xdist | ||
- macos: py311-xdist | ||
- linux: py311-cov | ||
coverage: codecov |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.ruff] | ||
line-length = 127 | ||
extend-ignore = [ | ||
"E501", # Line too long | ||
] |
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,47 @@ | ||
[tox] | ||
env_list = | ||
check-{style} | ||
test{,-warnings}{,-cov}-xdist | ||
build-{docs,dist} | ||
|
||
[testenv:check-style] | ||
description = check code style, e.g. with flake8 | ||
skip_install = true | ||
deps = | ||
ruff | ||
commands = | ||
ruff check . {posargs} | ||
|
||
[testenv] | ||
description = | ||
run tests | ||
warnings: treating warnings as errors | ||
cov: with coverage | ||
xdist: using parallel processing | ||
package = editable | ||
deps = | ||
pytest | ||
xdist: pytest-xdist | ||
cov: pytest-cov | ||
commands_pre = | ||
pip freeze | ||
commands = | ||
pytest \ | ||
warnings: -W error \ | ||
cov: --cov=. --cov-config=pyproject.toml --cov-report=term-missing --cov-report=xml \ | ||
xdist: -n auto \ | ||
{posargs} | ||
|
||
[testenv:build-docs] | ||
description = invoke sphinx-build to build the HTML docs | ||
extras = docs | ||
commands = | ||
sphinx-build -b html docs docs/_build/html | ||
|
||
[testenv:build-dist] | ||
description = build wheel and sdist | ||
skip_install = true | ||
deps = | ||
build | ||
commands = | ||
python -m build . |