Skip to content

chore: Pin dependencies for linters #397

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 3 commits into from
Jan 31, 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nitpick, but can we consistently use _ or - for file and directory names?

Copy link
Contributor

@texastony texastony Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this repo, there is a mostly consistent policy that directories use _ and files use -.

I do not see the value in this policy.
I do not know how this came to be.
I am not going to suggest we enforce it in any way.
But since this already meets the policy, I suggest we leave it as is.

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
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
26 changes: 11 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -176,8 +175,7 @@ commands =
basepython = python3
deps =
{[testenv]deps}
pyflakes
pylint
-rdev_requirements/linter-requirements.txt
commands =
pylint \
--rcfile=src/pylintrc \
Expand Down Expand Up @@ -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/ \
Expand All @@ -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 \
Expand All @@ -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]
Expand Down