Skip to content

Commit

Permalink
Tox testenv pipeline compliance (#11)
Browse files Browse the repository at this point in the history
need #12
  • Loading branch information
fvalette-ledger authored Jul 12, 2024
2 parents a4e427f + 084cbcd commit 36322c5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 36 deletions.
14 changes: 4 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,13 @@ svd2json = "svd2json:run"

[project.optional-dependencies]
devel = [
"coverage>=0.4",
"flake8>=7.0,<8.0",
"mypy>=1.8.0",
"pytest>=4.6",
"pytest-cov>=5.0.0",
"cachetools>=5.3",
]
lint = [
"black>=24.2,<25.0",
"flake8>=7.0,<8.0",
"flake8-html>=0.4.3",
]
type = [
"mypy>=1.8.0",
"lxml>=4.8.0",
"pydoclint",
"flake8-docstrings",
]
doc = [
"Sphinx>=7.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/svd2json/svd2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def _parse_interrupt(self, node: ElementTree.Element) -> None:

def _peripheral_name_fixup(self) -> None:
"""
Peripheral(s) name fixup.
Some SVD may have the peripheral's name as prefix for register's name
As this is not consistent **AND** there is already such a concatenation
in peripherals layout template, we can trim this
Expand Down
39 changes: 13 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,27 @@
min_version = 4.0
env_list =
lint
license
type
unittests
htmlcov
docs
isolated_build = true

[tox:.package]
basepython = python3

[testenv]
# extras = devel
extras = devel

[testenv:unittests]
extras = devel
commands =
pytest --cov=svd2json --tb=long -v {posargs}
coverage report -m
coverage xml

[testenv:htmlcov]
extras = devel
commands =
coverage run --parallel-mode -m pytest {posargs}
coverage combine
coverage report
coverage html --directory=reports/testcov

[testenv:lint]
extras = lint
commands =
black --line-length 100 --check --diff .

[testenv:type]
extras = type
commands =
mypy -p svd2json --html-report reports/mypycov

[testenv:licenses]
extras = license
commands = reuse lint
mypy -p svd2json
flake8 --docstring-convention=numpy

[testenv:docs]
extras = doc
Expand All @@ -54,14 +34,21 @@ commands =
sphinx-build -b simplepdf doc/ .doc/_pdf

[flake8]
select = C, E, F, W, B, B9
select = C, D, E, F, W, B, B9, DOC

# XXX:
# Some flake8 rules conflicts with Black and/or aren't PEP8 compliant, in case of conflit we
# choose the Black way of doing.
# - E203: is not PEP8 compliant and conflit with blake, must be disabled
# - E704: complain about collapse impl. for ellided func/method/class which is allowed by PEP8
# Black will ensure that this is the only case in which one should write a oneliner.
ignore = E203, E704
#
# As doc lint is a new feature, this is widely incomplete.
# We should ignore D1xx (missing docstring) temporarilly.
# Once everything is documented, re-enable this error.
ignore = D1, E203, E704
max-line-length = 100
exclude = .git, .github, __pycache__, build, dist, .eggs, .tox, venv, venv*, .venv, .venv*, reports, .mypy_cache
exclude = .git, .github, __pycache__, build, dist, .eggs, .tox, venv, venv*, .venv, .venv*, reports, .mypy_cache, doc
# pydoclint (flake8) plugin opt --style
style = numpy
statistics = True

0 comments on commit 36322c5

Please sign in to comment.