-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'morosi-cookiecutter' into 'master'
Use the cookiecutter template in e3-core See merge request it/e3-core!11
- Loading branch information
Showing
3 changed files
with
67 additions
and
99 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
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
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,63 +1,49 @@ | ||
[tox] | ||
envlist = py311-cov-xdist | ||
isolated_build = True | ||
envlist = | ||
py311-cov-xdist, | ||
check | ||
isolated_build=True | ||
|
||
[testenv] | ||
passenv = CI,GITHUB_*,CODECOV_* | ||
|
||
deps = | ||
xdist: pytest-xdist[psutil] | ||
cov: pytest-cov | ||
cov: coverage | ||
|
||
passenv = CI,GITHUB_*,CODECOV_* | ||
extras = | ||
config | ||
test | ||
codecov: codecov | ||
extras = test | ||
|
||
# Run testsuite with coverage when '-cov' is in the env name | ||
# Run testsuite with coverage when '-cov' and with multi-threading when '-xdist' | ||
# is in the env name | ||
commands= | ||
pytest --ignore=build -vv --html=pytest-report.html --self-contained-html \ | ||
pytest -vv --ignore=build -v --html=pytest-report.html \ | ||
--junit-xml=pytest-report.xml --self-contained-html \ | ||
xdist: -n auto \ | ||
cov: --e3-cov-rewrite {envsitepackagesdir} src \ | ||
cov: --cov={envsitepackagesdir}/e3 --cov-branch \ | ||
cov: --cov {envsitepackagesdir}/e3 --cov-branch \ | ||
[] | ||
codecov: codecov | ||
|
||
[testenv:mypy] | ||
# Run mypy | ||
extras = | ||
config | ||
check | ||
[testenv:check] | ||
extras = check | ||
commands = | ||
mypy -- {toxinidir}/src | ||
|
||
|
||
[testenv:security] | ||
# Run pip audit, and bandit | ||
extras = | ||
config | ||
check | ||
commands = | ||
# Accept yaml.load(), pickle, and exec since this | ||
# is needed by e3. Also temporarily accept sha1 usage until this is replaced by | ||
# more secure alternative. There is also e3.env.tmp_dir that returns the TMPDIR | ||
# Run bandit checks. Accept yaml.load(), pickle, and exec since this | ||
# is needed by e3. There is also e3.env.tmp_dir that returns the TMPDIR | ||
# environment variable. Don't check for that. | ||
# B202: should be investigated see https://github.com/AdaCore/e3-core/issues/694 | ||
bandit -r src/e3 -ll -ii -s B102,B108,B202,B301,B303,B506 | ||
# Ignore B324 that is no longer similar to B303 since Python3.9. | ||
bandit -r {toxinidir}/src -ll -ii -s B102,B108,B301,B506,B303,B324,B202 | ||
mypy {toxinidir}/src | ||
|
||
[testenv:docs] | ||
deps = | ||
sphinx | ||
sphinx-autoapi | ||
sphinx_rtd_theme==1.3.0 | ||
changedir = docs | ||
extras = doc | ||
commands = | ||
python -msphinx -M html {toxinidir}/docs/source {toxinidir}/docs/build | ||
sphinx-build -q -b html -d build/doctrees source build/html | ||
|
||
[flake8] | ||
exclude = .git,__pycache__,build,dist,.tox | ||
# Ignored: | ||
# A005: the module is shadowing a Python builtin module. We have many modules | ||
# doing that (logging, json ...) | ||
ignore = A003, A005, C901, E203, E266, E501, W503,D100,D101,D102,D102,D103,D104,D105,D106,D107,D203,D403,D213,B028,B906,B907,E704 | ||
ignore = B301,C901,E203,E266,E501,W503,D100,D101,D102,D102,D103,D104,D105,D106,D107,D203,D403,D213,E704,A003,A005,B028,B906,B907 | ||
# line length is intentionally set to 80 here because black uses Bugbear | ||
# See https://github.com/psf/black/blob/master/README.md#line-length for more details | ||
max-line-length = 80 | ||
select = A,ANN,B,B9,BLK,C,D,E,F,ISC,RST,T4,W | ||
select = B,C,D,E,F,W,T4,B9,A,ANN,BLK,ISC,RST |