Skip to content

Commit 69ee2fd

Browse files
authored
chore: pin linter dependencies (#198)
1 parent e323c96 commit 69ee2fd

File tree

12 files changed

+53
-30
lines changed

12 files changed

+53
-30
lines changed

.github/workflows/ci_tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
# - examples
3939
steps:
4040
- uses: actions/checkout@v2
41-
- uses: actions/setup-python@v1
41+
- uses: actions/setup-python@v2
4242
with:
4343
python-version: 2.7
4444
architecture: ${{ matrix.platform.architecture }}
@@ -79,7 +79,7 @@ jobs:
7979
# - examples
8080
steps:
8181
- uses: actions/checkout@v2
82-
- uses: actions/setup-python@v1
82+
- uses: actions/setup-python@v2
8383
with:
8484
python-version: ${{ matrix.python }}
8585
architecture: ${{ matrix.platform.architecture }}

codebuild/python2.7.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ phases:
1414
python: latest
1515
build:
1616
commands:
17-
- pip install tox
17+
- pyenv install 2.7.17
18+
- pyenv local 2.7.17
19+
- pip install tox tox-pyenv
1820
- tox

codebuild/python3.6.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ phases:
1414
python: latest
1515
build:
1616
commands:
17-
- pip install tox
17+
- pyenv install 3.6.15
18+
- pyenv local 3.6.15
19+
- pip install tox tox-pyenv
1820
- tox

codebuild/python3.8.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ phases:
1414
python: latest
1515
build:
1616
commands:
17-
- pip install tox
17+
- pyenv install 3.8.12
18+
- pyenv local 3.8.12
19+
- pip install tox tox-pyenv
1820
- tox
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bandit==1.7.0
2+
black==21.12b0
3+
doc8==0.10.1
4+
flake8==4.0.1
5+
flake8-bugbear==21.11.29
6+
flake8-docstrings==1.6.0
7+
flake8-isort==4.1.1
8+
flake8-print==4.0.0
9+
isort==5.10.1
10+
pydocstyle==3.0.0
11+
pyflakes==2.4.0
12+
pylint==2.12.2
13+
readme_renderer==32.0
14+
seed-isort-config==2.2.0
15+
vulture==2.3
16+
sphinx==4.4.0

doc/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_version():
2929
return _release
3030

3131

32-
project = u"dynamodb-encryption-sdk-python"
32+
project = u"dynamodb-encryption-sdk-python" # pylint: disable=redundant-u-string-prefix
3333
version = get_version()
3434
release = get_release()
3535

@@ -53,7 +53,7 @@ def get_version():
5353
source_suffix = ".rst" # The suffix of source filenames.
5454
master_doc = "index" # The master toctree document.
5555

56-
copyright = u"%s, Amazon" % datetime.now().year # pylint: disable=redefined-builtin
56+
copyright = u"%s, Amazon" % datetime.now().year # pylint: disable=redefined-builtin,redundant-u-string-prefix
5757

5858
# List of directories, relative to source directory, that shouldn't be searched
5959
# for source files.

examples/test/pylintrc

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ disable =
1010
# pylint does not recognize this
1111
duplicate-code, # tests for similar things tend to be similar
1212
redefined-outer-name, # raises false positives with fixtures
13+
consider-using-f-string,
1314

1415
[DESIGN]
1516
max-args = 10

src/pylintrc

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ disable =
88
useless-object-inheritance,
99
raise-missing-from,
1010
super-with-arguments,
11+
consider-using-f-string
1112

1213
[BASIC]
1314
# Allow function names up to 50 characters

test/pylintrc

+3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ disable =
1010
protected-access, # raised when calling _ methods
1111
redefined-outer-name, # raised when using pytest-mock
1212
unused-argument, # raised when patches and fixtures are needed but not called
13+
unspecified-encoding,
1314
# All below are disabled because we need to support Python 2
1415
useless-object-inheritance,
1516
raise-missing-from,
1617
super-with-arguments,
18+
consider-using-f-string,
19+
redundant-u-string-prefix,
1720

1821
[DESIGN]
1922
max-args = 10

test/requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
hypothesis>=5.0.0,<6.0.0;python_version>='3'
22
hypothesis==4.57.1;python_version=='2.7'
33
mock
4-
moto>=1.3.8
4+
moto>=1.3.8;python_version>='3'
5+
# must be less than 2.2.x as Moto removed support for python2 as of moto 2.2.x.
6+
# https://github.com/spulec/moto/issues/3612
7+
moto>=1.3.8,<2.2.0;python_version=='2.7'
58
pytest>=3.4.0
69
pytest-cov
710
pytest-mock

test/unit/material_providers/test_aws_kms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_loaded_key_infos():
225225
[
226226
pytest.param(val, id=str(val))
227227
for val in all_possible_combinations_kwargs(
228-
dict(),
228+
{},
229229
dict(botocore_session=botocore.session.Session()),
230230
dict(grant_tokens=("sdvoaweih", "auwshefiouawh")),
231231
dict(material_description={"asoiufeoia": "soajfijewi"}),

tox.ini

+14-21
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,7 @@ commands =
216216
[testenv:flake8]
217217
basepython = python3
218218
deps =
219-
flake8
220-
flake8-docstrings
221-
flake8-isort
222-
# https://github.com/PyCQA/pydocstyle/issues/375
223-
pydocstyle<4.0.0
224-
# https://github.com/JBKahn/flake8-print/pull/30
225-
flake8-print>=3.1.0
219+
-rdev_requirements/linter-requirements.txt
226220
commands =
227221
flake8 \
228222
src/dynamodb_encryption_sdk/ \
@@ -238,7 +232,7 @@ commands =
238232
# Ignore D101-107 docstring requirements for tests
239233
# E203 is not PEP8 compliant https://github.com/ambv/black#slices
240234
# W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators
241-
--ignore F811,D101,D102,D103,D107,E203,W503 \
235+
--ignore F811,D101,D102,D103,D107,E203,W503,B011 \
242236
test/
243237

244238
[testenv:flake8-examples]
@@ -261,8 +255,7 @@ commands =
261255
basepython = python3
262256
deps =
263257
{[testenv]deps}
264-
pyflakes
265-
pylint
258+
-rdev_requirements/linter-requirements.txt
266259
commands =
267260
pylint \
268261
--rcfile=src/pylintrc \
@@ -291,7 +284,7 @@ commands =
291284
[testenv:blacken-src]
292285
basepython = python3
293286
deps =
294-
black
287+
-rdev_requirements/linter-requirements.txt
295288
commands =
296289
black --line-length 120 \
297290
src/dynamodb_encryption_sdk/ \
@@ -324,9 +317,8 @@ commands = seed-isort-config
324317

325318
[testenv:isort]
326319
basepython = python3
327-
# We need >=5.0.0 because
328-
# several configuration settings changed with 5.0.0
329-
deps = isort>=5.0.0
320+
deps =
321+
-rdev_requirements/linter-requirements.txt
330322
commands = isort \
331323
src \
332324
test \
@@ -366,27 +358,28 @@ commands =
366358
basepython = python3
367359
whitelist_externals = {[testenv:resetdocs]whitelist_externals}
368360
deps =
369-
sphinx
370-
doc8
371-
commands =
361+
-rdev_requirements/linter-requirements.txt
362+
commands =
372363
{[testenv:resetdocs]commands}
373364
doc8 doc/index.rst doc/lib/ README.rst CHANGELOG.rst
374-
375365

376366
[testenv:readme]
377367
basepython = python3
378-
deps = readme_renderer
368+
deps =
369+
-rdev_requirements/linter-requirements.txt
379370
commands = python setup.py check -r -s
380371

381372
[testenv:bandit]
382373
basepython = python3
383-
deps = bandit
374+
deps =
375+
-rdev_requirements/linter-requirements.txt
384376
commands = bandit -r src/dynamodb_encryption_sdk/
385377

386378
# Prone to false positives: only run independently
387379
[testenv:vulture]
388380
basepython = python3
389-
deps = vulture
381+
deps =
382+
-rdev_requirements/linter-requirements.txt
390383
commands = vulture src/dynamodb_encryption_sdk/
391384

392385
[testenv:linters]

0 commit comments

Comments
 (0)