Skip to content

Commit c65f00d

Browse files
committed
2 parents af72339 + ca1831c commit c65f00d

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

.github/workflows/main.yml

+22-22
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,17 @@ permissions:
66
contents: read
77

88
env:
9-
# Environment variables to support color support (jaraco/skeleton#66):
10-
# Request colored output from CLI tools supporting it. Different tools
11-
# interpret the value differently. For some, just being set is sufficient.
12-
# For others, it must be a non-zero integer. For yet others, being set
13-
# to a non-empty value is sufficient. For tox, it must be one of
14-
# <blank>, 0, 1, false, no, off, on, true, yes. The only enabling value
15-
# in common is "1".
9+
# Environment variable to support color support (jaraco/skeleton#66)
1610
FORCE_COLOR: 1
17-
# MyPy's color enforcement (must be a non-zero number)
18-
MYPY_FORCE_COLOR: -42
19-
# Recognized by the `py` package, dependency of `pytest` (must be "1")
20-
PY_COLORS: 1
21-
# Make tox-wrapped tools see color requests
22-
TOX_TESTENV_PASSENV: >-
23-
FORCE_COLOR
24-
MYPY_FORCE_COLOR
25-
NO_COLOR
26-
PY_COLORS
27-
PYTEST_THEME
28-
PYTEST_THEME_MODE
2911

3012
# Suppress noisy pip warnings
3113
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
3214
PIP_NO_PYTHON_VERSION_WARNING: 'true'
3315
PIP_NO_WARN_SCRIPT_LOCATION: 'true'
3416

35-
# Disable the spinner, noise in GHA; TODO(webknjaz): Fix this upstream
36-
# Must be "1".
37-
TOX_PARALLEL_NO_SPINNER: 1
17+
# Ensure tests can sense settings about the environment
18+
TOX_OVERRIDE: >-
19+
testenv.pass_env+=GITHUB_*,FORCE_COLOR
3820
3921
4022
jobs:
@@ -71,6 +53,24 @@ jobs:
7153
- name: Run
7254
run: tox
7355

56+
diffcov:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v3
60+
with:
61+
fetch-depth: 0
62+
- name: Setup Python
63+
uses: actions/setup-python@v4
64+
with:
65+
python-version: 3.x
66+
- name: Install tox
67+
run: |
68+
python -m pip install tox
69+
- name: Evaluate coverage
70+
run: tox
71+
env:
72+
TOXENV: diffcov
73+
7474
docs:
7575
runs-on: ubuntu-latest
7676
env:

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ testing =
5353
docs =
5454
# upstream
5555
sphinx >= 3.5
56+
# workaround for sphinx/sphinx-doc#11662
57+
sphinx < 7.2.5
5658
jaraco.packaging >= 9.3
5759
rst.linker >= 1.9
5860
furo

tox.ini

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[testenv]
2+
description = perform primary checks (tests, style, types, coverage)
23
deps =
34
setenv =
45
PYTHONWARNDEFAULTENCODING = 1
@@ -8,7 +9,17 @@ usedevelop = True
89
extras =
910
testing
1011

12+
[testenv:diffcov]
13+
description = run tests and check that diff from main is covered
14+
deps =
15+
diff-cover
16+
commands =
17+
pytest {posargs} --cov-report xml
18+
diff-cover coverage.xml --compare-branch=origin/main --html-report diffcov.html
19+
diff-cover coverage.xml --compare-branch=origin/main --fail-under=100
20+
1121
[testenv:docs]
22+
description = build the documentation
1223
extras =
1324
docs
1425
testing
@@ -18,22 +29,24 @@ commands =
1829
python -m sphinxlint
1930

2031
[testenv:finalize]
32+
description = assemble changelog and tag a release
2133
skip_install = True
2234
deps =
2335
towncrier
2436
jaraco.develop >= 7.23
25-
passenv = *
37+
pass_env = *
2638
commands =
2739
python -m jaraco.develop.finalize
2840

2941

3042
[testenv:release]
43+
description = publish the package to PyPI and GitHub
3144
skip_install = True
3245
deps =
3346
build
3447
twine>=3
3548
jaraco.develop>=7.1
36-
passenv =
49+
pass_env =
3750
TWINE_PASSWORD
3851
GITHUB_TOKEN
3952
setenv =

0 commit comments

Comments
 (0)