diff --git a/dev_requirements/linter-requirements.txt b/dev_requirements/linter-requirements.txt new file mode 100644 index 000000000..a1e5aa3d4 --- /dev/null +++ b/dev_requirements/linter-requirements.txt @@ -0,0 +1,14 @@ +bandit==1.7.0 +black==21.12b0 +doc8==0.10.1 +flake8==4.0.1 +flake8-bugbear==21.11.29 +flake8-docstrings==1.6.0 +flake8-print==4.0.0 +isort==5.10.1 +pyflakes==2.4.0 +pylint==2.12.2 +readme_renderer==32.0 +seed-isort-config==2.2.0 +vulture==2.3 +sphinx==4.3.2 \ No newline at end of file diff --git a/test/unit/test_encryption_context.py b/test/unit/test_encryption_context.py index 094430707..ccc18c219 100644 --- a/test/unit/test_encryption_context.py +++ b/test/unit/test_encryption_context.py @@ -189,4 +189,4 @@ def test_deserialize_encryption_context_empty(self): test = aws_encryption_sdk.internal.formatting.encryption_context.deserialize_encryption_context( serialized_encryption_context=b"" ) - assert test == {} + assert not test diff --git a/tox.ini b/tox.ini index b0221eee2..10506814f 100644 --- a/tox.ini +++ b/tox.ini @@ -149,15 +149,14 @@ commands = [testenv:flake8-tests] basepython = {[testenv:flake8]basepython} deps = - flake8 - # https://github.com/JBKahn/flake8-print/pull/30 - flake8-print>=3.1.0 + -rdev_requirements/linter-requirements.txt commands = flake8 \ # Ignore F811 redefinition errors in tests (breaks with pytest-mock use) # E203 is not PEP8 compliant https://github.com/ambv/black#slices # W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators - --ignore F811,E203,W503 \ + # D is for Documentation. We do not care if Test classes and their methods have docstrings + --ignore F811,E203,W503,D \ test/ [testenv:flake8-examples] @@ -176,8 +175,7 @@ commands = basepython = python3 deps = {[testenv]deps} - pyflakes - pylint + -rdev_requirements/linter-requirements.txt commands = pylint \ --rcfile=src/pylintrc \ @@ -205,7 +203,7 @@ commands = [testenv:blacken-src] basepython = python3 deps = - black + -rdev_requirements/linter-requirements.txt commands = black --line-length 120 \ src/aws_encryption_sdk/ \ @@ -232,12 +230,12 @@ commands = [testenv:isort-seed] basepython = python3 -deps = seed-isort-config +deps = -rdev_requirements/linter-requirements.txt commands = seed-isort-config [testenv:isort] basepython = python3 -deps = isort +deps = -rdev_requirements/linter-requirements.txt commands = isort -rc \ src \ test \ @@ -264,25 +262,23 @@ commands = [testenv:doc8] basepython = python3 deps = - sphinx - doc8 + -rdev_requirements/linter-requirements.txt commands = doc8 doc/index.rst README.rst CHANGELOG.rst [testenv:readme] basepython = python3 -deps = readme_renderer +deps = -rdev_requirements/linter-requirements.txt commands = python setup.py check -r -s [testenv:bandit] basepython = python3 -deps = - bandit>=1.5.1 +deps = -rdev_requirements/linter-requirements.txt commands = bandit -r src/aws_encryption_sdk/ # Prone to false positives: only run independently [testenv:vulture] basepython = python3 -deps = vulture +deps = -rdev_requirements/linter-requirements.txt commands = vulture src/aws_encryption_sdk/ [testenv:linters]