Skip to content

Commit

Permalink
Rename tox envs by task not technology (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl authored Feb 14, 2024
2 parents e18b238 + ee5a4e9 commit 63d0f15
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
pip-install: ".[dev]"

- name: Run tests
run: tox -e pytest
run: tox -e tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/coverage.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# How to check code coverage

Code coverage is reported to the command line and to a `cov.xml` file by the command `tox -e pytest`. The file is uploaded to the Codecov service in CI.
Code coverage is reported to the command line and to a `cov.xml` file by the command `tox -e tests`. The file is uploaded to the Codecov service in CI.

## Adding a Codecov Token

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/run-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $ pytest
When you have some fully working tests then you can run it with coverage:

```
$ tox -e pytest-cov
$ tox -e tests
```

It will also report coverage to the commandline and to `cov.xml`.
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/static-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Static type analysis is done with [pyright](https://microsoft.github.io/pyright/). It checks type definition in source files without running them, and highlights potential issues where types do not match. You can run it with:

```
$ tox -e pyright
$ tox -e type-checking
```
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ legacy_tox_ini = """
[tox]
skipsdist=True
[testenv:{pre-commit,pytest,docs}]
[testenv:{pre-commit,tests,docs}]
# Don't create a virtualenv for the command, requires tox-direct plugin
direct = True
passenv = *
Expand All @@ -49,7 +49,7 @@ allowlist_externals =
sphinx-autobuild
commands =
pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
pytest: pytest {posargs}
tests: pytest {posargs}
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
"""

Expand Down
6 changes: 3 additions & 3 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ legacy_tox_ini = """
[tox]
skipsdist=True

[testenv:{pre-commit,pyright,pytest{% if sphinx %},docs{% endif %}}]
[testenv:{pre-commit,type-checking,tests{% if sphinx %},docs{% endif %}}]
# Don't create a virtualenv for the command, requires tox-direct plugin
direct = True
passenv = *
Expand All @@ -90,9 +90,9 @@ allowlist_externals =
{% if sphinx %} sphinx-build
sphinx-autobuild
{% endif %}commands =
pytest: pytest --cov={{ package_name }} --cov-report term --cov-report xml:cov.xml {posargs}
pyright: pyright src tests {posargs}
pre-commit: pre-commit run --all-files {posargs}
type-checking: pyright src tests {posargs}
tests: pytest --cov={{ package_name }} --cov-report term --cov-report xml:cov.xml {posargs}
{% if sphinx %} docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
{% endif %}"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_tox.yml
with:
tox: pre-commit,pyright
tox: pre-commit,type-checking
{% raw %}
test:
needs: check
Expand Down

0 comments on commit 63d0f15

Please sign in to comment.