Skip to content

Commit

Permalink
Bump tox, remove codecov, bump pypy, add typing, Papa John's.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Dec 14, 2022
1 parent a5cd58c commit ecf6675
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 68 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- uses: pre-commit/[email protected]

ci:
Expand All @@ -26,9 +26,9 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest]
python-version:
- name: pypy-3.8
- name: pypy-3.9
toxenv: pypy3-tests
- name: pypy-3.8
- name: pypy-3.9
toxenv: pypypytest3
- name: 3.7
toxenv: py37-build
Expand All @@ -46,24 +46,33 @@ jobs:
toxenv: py310-build
- name: "3.10"
toxenv: py310-tests
- name: "3.10"
- name: "3.11"
toxenv: py311-build
- name: "3.11"
toxenv: py311-tests
- name: "3.11"
toxenv: docs-dirhtml
- name: "3.10"
- name: "3.11"
toxenv: docs-doctest
- name: "3.10"
- name: "3.11"
toxenv: docs-linkcheck
- name: "3.10"
- name: "3.11"
toxenv: docs-spelling
- name: "3.10"
- name: "3.11"
toxenv: docs-style
- name: "3.10"
- name: "3.11"
toxenv: readme
- name: "3.10"
toxenv: safety
- name: "3.10"
- name: "3.11"
toxenv: secrets
- name: "3.10"
- name: "3.11"
toxenv: style
- name: "3.11"
toxenv: typing
include:
- os: ubuntu-latest
python-version:
name: "3.11"
toxenv: py311-ghcoverage

steps:
- uses: actions/checkout@v3
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/coverage.yml

This file was deleted.

5 changes: 0 additions & 5 deletions codecov.yml

This file was deleted.

61 changes: 34 additions & 27 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
[tox]
min_version = 4.0.9
envlist =
py{37,38,39,310,311,py3}-{build,tests}
pypypytest3
audit
readme
safety
secrets
style
typing
docs-{dirhtml,doctest,linkcheck,spelling,style}
skipsdist = True

[testenv]
changedir = {envtmpdir}
passenv = CODECOV* CI
passenv = CI, GITHUB_STEP_SUMMARY, PYTHONUTF8
setenv =
PYTHONWARNINGS=default

coverage,codecov: MAYBE_COVERAGE = coverage run -m
coverage,codecov: COVERAGE_RCFILE={toxinidir}/.coveragerc
coverage,codecov: COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug
coverage,codecov: COVERAGE_FILE={envtmpdir}/coverage-data
coverage,ghcoverage: MAYBE_COVERAGE=coverage run -m
coverage,ghcoverage: COVERAGE_RCFILE={toxinidir}/.coveragerc
coverage,ghcoverage: COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug
coverage,ghcoverage: COVERAGE_FILE={envtmpdir}/coverage-data
allowlist_externals =
mkdir
sh
commands =
{envpython} -m pip install --disable-pip-version-check {toxinidir}
build: {envpython} -m build {toxinidir} --outdir {envtmpdir}/dist
!build: {envpython} -m pip install --disable-pip-version-check {toxinidir}

tests,coverage,codecov: {envpython} -m {env:MAYBE_COVERAGE:} virtue {posargs:regret}
tests,coverage,ghcoverage: {envpython} -m {env:MAYBE_COVERAGE:} virtue {posargs:regret}
tests: {envpython} -m doctest {toxinidir}/README.rst

coverage: {envpython} -m coverage report --show-missing
coverage: {envpython} -m coverage html --directory={envtmpdir}/htmlcov
codecov: {envpython} -m coverage xml -o {envtmpdir}/coverage.xml
codecov: codecov --required --disable gcov --file {envtmpdir}/coverage.xml

build: {envpython} -m build {toxinidir} --outdir {envtmpdir}/dist
deps =
audit: pip-audit
build: build

tests,coverage,codecov: virtue
tests,coverage,codecov,pypypytest3: -r{toxinidir}/test-requirements.txt
coverage,codecov: coverage
codecov: codecov

[testenv:bandit]
deps = bandit
commands = {envpython} -m bandit --recursive {toxinidir}/regret
tests,coverage,ghcoverage: virtue
tests,coverage,ghcoverage,pypypytest3: -r{toxinidir}/test-requirements.txt
coverage,ghcoverage: coverage

[testenv:pypypytest3]
basepython = pypy3
Expand All @@ -54,19 +52,19 @@ deps =
{[testenv]deps}
pytest

[testenv:bandit]
deps = bandit
commands = {envpython} -m bandit --recursive {toxinidir}/regret

[testenv:readme]
deps =
build
docutils
twine
commands =
{envpython} -m build --outdir {envtmpdir}/dist {toxinidir}
{envpython} -m twine check {envtmpdir}/dist/*

[testenv:safety]
deps = safety
commands =
{envpython} -m pip install --disable-pip-version-check {toxinidir}
{envpython} -m safety check
{envbindir}/rst2html5.py --halt=warning {toxinidir}/CONTRIBUTING.rst /dev/null

[testenv:secrets]
deps = detect-secrets
Expand All @@ -83,6 +81,15 @@ deps =
commands =
{envpython} -m flake8 {posargs} --max-complexity 10 {toxinidir}/regret {toxinidir}/docs

[testenv:typing]
skip_install = true
deps =
# FIXME: Why are we repeating dependencies here?
attrs
mypy
twisted
commands = {envpython} -m mypy --config {toxinidir}/pyproject.toml {posargs} {toxinidir}/regret

[testenv:docs-dirhtml]
commands = {envpython} -m sphinx -b dirhtml {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W}
deps = -r{toxinidir}/docs/requirements.txt
Expand All @@ -101,7 +108,7 @@ deps = {[testenv:docs-dirhtml]deps}

[testenv:docs-style]
commands =
doc8 --ignore-path {toxinidir}/docs/requirements.txt {posargs} {toxinidir}/docs
doc8 --max-line-length 1000 --ignore-path {toxinidir}/docs/requirements.txt {posargs} {toxinidir}/docs
deps =
doc8
pygments
Expand Down

0 comments on commit ecf6675

Please sign in to comment.