From 5c1fc93ff9e9fa6ecb414096a401def5da5e7a6c Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Mon, 22 Jun 2020 18:16:43 -0500 Subject: [PATCH] combine tox deps in order to unconfuse flake8-isort with pytest not being included in the lint environment, flake8-isort didn't know how to treat it vs. incorporealcms imports, leading to false positives only inside tox. this makes it so that certain packages (defined in base deps) can be imported in any/all envs, because they show up in analyzed/imported/etc code rather than being merely tools --- tox.ini | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 3e740ab..d3c4833 100644 --- a/tox.ini +++ b/tox.ini @@ -14,15 +14,22 @@ wheel_build_env = build # whitelist commands we need whitelist_externals = ln +# for environment sanity, things that are in written code being security +# checked, linted, etc., but are not part of the installed package, should +# go here, so that all envs may benefit from them +[base] +deps = + pytest + [testenv:build] # require setuptools when building deps = setuptools [testenv:py37] -# run pytest and coverage +# run pytest with coverage deps = - pytest pytest-cov + {[base]deps} commands = pytest --cov={envsitepackagesdir}/incorporealcms/ \ --cov-report=term-missing --cov-branch --cov-fail-under=90 @@ -34,6 +41,7 @@ commands = # again it seems the most valuable here to run against the packaged code deps = bandit + {[base]deps} commands = bandit {envsitepackagesdir}/incorporealcms/ -r @@ -50,6 +58,7 @@ deps = flake8-fixme flake8-isort flake8-logging-format + {[base]deps} commands = flake8 - flake8 --disable-noqa --select=E,W,F,C,D,A,G,B,I,DUO @@ -75,9 +84,6 @@ max-line-length = 120 [isort] line_length = 120 -# only way I could figure out how to make tests/conftest.py happy and have pytest separate from incorporealcms -# and if I let them be combined in tox runs, flake8-isort in vim would complain :( -forced_separate = incorporealcms [pytest] python_files =