Skip to content

chore: Pin linter dependencies #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions dev_requirements/linter-requirements.txt
Original file line number Diff line number Diff line change
@@ -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.4.0
2 changes: 1 addition & 1 deletion test/unit/test_encryption_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 13 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,21 @@ commands = {[testenv:test-upstream-requirements-base]commands}
[testenv:flake8]
basepython = python3
deps =
flake8
flake8-docstrings>=1.5.0
# https://github.com/JBKahn/flake8-print/pull/30
flake8-print>=3.1.0
flake8-bugbear
-rdev_requirements/linter-requirements.txt
commands =
flake8 src/aws_encryption_sdk/ setup.py

[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]
Expand All @@ -172,8 +167,7 @@ commands =
basepython = python3
deps =
{[testenv]deps}
pyflakes
pylint
-rdev_requirements/linter-requirements.txt
commands =
pylint \
--rcfile=src/pylintrc \
Expand All @@ -200,7 +194,7 @@ commands =
[testenv:blacken-src]
basepython = python3
deps =
black
-rdev_requirements/linter-requirements.txt
commands =
black --line-length 120 \
src/aws_encryption_sdk/ \
Expand All @@ -227,12 +221,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 \
Expand All @@ -259,25 +253,24 @@ 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]
Expand Down