Skip to content

Commit f694bcd

Browse files
authored
chore: pin linter dependencies and enable dependabot (aws#192)
1 parent b7aeaf7 commit f694bcd

14 files changed

+73
-59
lines changed

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
# master
4+
- package-ecosystem: "pip"
5+
directory: "/dev_requirements"
6+
schedule:
7+
interval: "daily"
8+
9+
# Github Actions
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"

.github/workflows/ci_static-analysis.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python-version: 3.8
3838
- run: |
3939
python -m pip install --upgrade pip
40-
pip install --upgrade -r ci-requirements.txt
40+
pip install --upgrade -r dev_requirements/ci-requirements.txt
4141
- name: check
4242
env:
4343
TOXENV: ${{ matrix.category }}

.github/workflows/ci_tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
architecture: ${{ matrix.platform.architecture }}
4545
- run: |
4646
python -m pip install --upgrade pip
47-
pip install --upgrade -r ci-requirements.txt
47+
pip install --upgrade -r dev_requirements/ci-requirements.txt
4848
- name: run test
4949
env:
5050
TOXENV: ${{ matrix.category }}
@@ -65,7 +65,7 @@ jobs:
6565
python-version: 3.7
6666
- run: |
6767
python -m pip install --upgrade pip
68-
pip install --upgrade -r ci-requirements.txt
68+
pip install --upgrade -r dev_requirements/ci-requirements.txt
6969
- name: run test
7070
env:
7171
TOXENV: ${{ matrix.category }}

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ submodules:
1717
python:
1818
version: 3.8
1919
install:
20-
- requirements: doc/requirements.txt
20+
- requirements: dev_requirements/doc-requirements.txt
2121
- method: setuptools
2222
path: .

ci-requirements.txt

-1
This file was deleted.

dev_requirements/ci-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tox==3.24.5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sphinx==4.2.0
1+
sphinx==4.4.0
22
sphinx_rtd_theme==1.0.0
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bandit==1.7.2
2+
black==22.1.0
3+
doc8==0.10.1
4+
flake8==4.0.1
5+
flake8-docstrings==1.6.0
6+
flake8-isort==4.1.1
7+
# https://github.com/JBKahn/flake8-print/pull/30
8+
flake8-print==4.0.0
9+
isort==5.10.1
10+
pylint==2.12.2
11+
pyflakes==2.4.0
12+
# https://github.com/PyCQA/pydocstyle/issues/375
13+
pydocstyle==3.0.0
14+
readme_renderer==32.0
15+
seed-isort-config==2.2.0
16+
vulture==2.3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pypi-parker==0.1.2
2+
setuptools==60.7.1
3+
twine==3.8.0
4+
wheel==0.37.1
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
hypothesis==5.49.0
2+
mock==4.0.3
3+
moto==3.0.2
4+
pytest==7.0.0
5+
pytest-cov==3.0.0
6+
pytest-mock==3.6.1
7+
pytest-xdist==2.5.0
8+
boto3==1.20.51
9+
botocore==1.23.51

test/freeze-upstream-requirements.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ if [ -z ${1} ]; then
66
fi
77

88
pip install -r requirements.txt
9-
pip install -r test/requirements.txt
9+
pip install -r dev_requirements/test-requirements.txt
1010
pip freeze > ${1}

test/requirements.txt

-10
This file was deleted.

test/source-build-check.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ EXTRACTEDDIR=$(ls | tail -1)
2626
cd ${EXTRACTEDDIR}
2727

2828
echo "Installing requirements from extracted source build."
29-
pip install -r test/requirements.txt
29+
pip install -r dev_requirements/test-requirements.txt
3030
pip install -e .
3131

3232
echo "Running tests from extracted source build."

tox.ini

+23-41
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ passenv =
6060
# Pass through the default AWS region (used for integration tests)
6161
AWS_DEFAULT_REGION
6262
sitepackages = False
63-
deps = -rtest/requirements.txt
63+
deps = -rdev_requirements/test-requirements.txt
6464
# 'download' forces tox to always upgrade pip to the latest
6565
download = true
6666
commands =
@@ -91,7 +91,7 @@ commands =
9191
# Do not select any specific markers
9292
manual: {[testenv:base-command]commands}
9393
# Only run examples tests
94-
examples: {[testenv:base-command]commands} examples/test/ -m "examples"
94+
examples: {[testenv:base-command]commands} examples/test -m "examples"
9595

9696
# Run code coverage on the unit tests
9797
[testenv:coverage]
@@ -106,7 +106,7 @@ sitepackages = False
106106
passenv =
107107
setenv =
108108
#########################################################
109-
deps = -rtest/requirements.txt
109+
deps = -rdev_requirements/test-requirements.txt
110110
commands = {[testenv:base-command]commands} -m "local and not slow and not veryslow and not nope" --ignore=examples
111111

112112
# Collect requirements for use in upstream tests
@@ -149,6 +149,7 @@ sitepackages = False
149149
recreate = True
150150
deps =
151151
{[testenv:build]deps}
152+
-rdev_requirements/test-requirements.txt
152153
commands =
153154
{[testenv:build]commands}
154155
{toxinidir}/test/source-build-check.sh {envtmpdir} {toxinidir}/dist
@@ -186,14 +187,7 @@ commands =
186187
# Linters
187188
[testenv:flake8]
188189
basepython = python3
189-
deps =
190-
flake8
191-
flake8-docstrings
192-
flake8-isort
193-
# https://github.com/PyCQA/pydocstyle/issues/375
194-
pydocstyle<4.0.0
195-
# https://github.com/JBKahn/flake8-print/pull/30
196-
flake8-print>=3.1.0
190+
deps = -rdev_requirements/linter-requirements.txt
197191
commands =
198192
flake8 \
199193
src/dynamodb_encryption_sdk/ \
@@ -202,7 +196,7 @@ commands =
202196

203197
[testenv:flake8-tests]
204198
basepython = {[testenv:flake8]basepython}
205-
deps = {[testenv:flake8]deps}
199+
deps = -rdev_requirements/linter-requirements.txt
206200
commands =
207201
flake8 \
208202
# Ignore F811 redefinition errors in tests (breaks with pytest-mock use)
@@ -214,7 +208,7 @@ commands =
214208

215209
[testenv:flake8-examples]
216210
basepython = {[testenv:flake8]basepython}
217-
deps = {[testenv:flake8]deps}
211+
deps = {[testenv:flake8]deps}
218212
commands =
219213
flake8 \
220214
# Ignore C901 complexity requirements (examples optimize for straightforward readability)
@@ -232,8 +226,7 @@ commands =
232226
basepython = python3
233227
deps =
234228
{[testenv]deps}
235-
pyflakes
236-
pylint
229+
-rdev_requirements/linter-requirements.txt
237230
commands =
238231
pylint \
239232
--rcfile=src/pylintrc \
@@ -261,8 +254,7 @@ commands =
261254

262255
[testenv:blacken-src]
263256
basepython = python3
264-
deps =
265-
black
257+
deps = -rdev_requirements/linter-requirements.txt
266258
commands =
267259
black --line-length 120 \
268260
src/dynamodb_encryption_sdk/ \
@@ -276,28 +268,24 @@ commands =
276268

277269
[testenv:blacken]
278270
basepython = python3
279-
deps =
280-
{[testenv:blacken-src]deps}
271+
deps = {[testenv:blacken-src]deps}
281272
commands =
282273
{[testenv:blacken-src]commands}
283274

284275
[testenv:black-check]
285276
basepython = python3
286-
deps =
287-
{[testenv:blacken]deps}
277+
deps = {[testenv:blacken]deps}
288278
commands =
289279
{[testenv:blacken-src]commands} --diff
290280

291281
[testenv:isort-seed]
292282
basepython = python3
293-
deps = seed-isort-config
283+
deps = -rdev_requirements/linter-requirements.txt
294284
commands = seed-isort-config
295285

296286
[testenv:isort]
297287
basepython = python3
298-
# We need >=5.0.0 because
299-
# several configuration settings changed with 5.0.0
300-
deps = isort>=5.0.0
288+
deps = -rdev_requirements/linter-requirements.txt
301289
commands = isort \
302290
src \
303291
test \
@@ -316,8 +304,8 @@ commands = {[testenv:isort]commands} -c
316304
[testenv:autoformat]
317305
basepython = python3
318306
deps =
319-
{[testenv:isort]deps}
320307
{[testenv:blacken]deps}
308+
{[testenv:isort]deps}
321309
commands =
322310
{[testenv:isort]commands}
323311
{[testenv:blacken]commands}
@@ -337,27 +325,27 @@ commands =
337325
basepython = python3
338326
whitelist_externals = {[testenv:resetdocs]whitelist_externals}
339327
deps =
340-
sphinx
341-
doc8
328+
-rdev_requirements/doc-requirements.txt
329+
-rdev_requirements/linter-requirements.txt
342330
commands =
343331
{[testenv:resetdocs]commands}
344332
doc8 doc/index.rst doc/lib/ README.rst CHANGELOG.rst
345333

346334

347335
[testenv:readme]
348336
basepython = python3
349-
deps = readme_renderer
337+
deps = -rdev_requirements/linter-requirements.txt
350338
commands = python setup.py check -r -s
351339

352340
[testenv:bandit]
353341
basepython = python3
354-
deps = bandit
342+
deps = -rdev_requirements/linter-requirements.txt
355343
commands = bandit -r src/dynamodb_encryption_sdk/
356344

357345
# Prone to false positives: only run independently
358346
[testenv:vulture]
359347
basepython = python3
360-
deps = vulture
348+
deps = -rdev_requirements/linter-requirements.txt
361349
commands = vulture src/dynamodb_encryption_sdk/
362350

363351
[testenv:linters]
@@ -387,7 +375,7 @@ commands =
387375
# Documentation
388376
[testenv:docs]
389377
basepython = python3
390-
deps = -rdoc/requirements.txt
378+
deps = -rdev_requirements/doc-requirements.txt
391379
commands =
392380
sphinx-build -E -c doc/ -b html doc/ doc/build/html
393381
sphinx-build -E -c doc/ -b linkcheck doc/ doc/build/html
@@ -404,27 +392,21 @@ commands =
404392
[testenv:park]
405393
basepython = python3
406394
skip_install = true
407-
deps =
408-
pypi-parker
409-
setuptools
395+
deps = -rdev_requirements/release-requirements.txt
410396
commands = python setup.py park
411397

412398
# Release tooling
413399
[testenv:build]
414400
basepython = python3
415401
skip_install = true
416-
deps =
417-
wheel
418-
setuptools
402+
deps = -rdev_requirements/release-requirements.txt
419403
commands =
420404
python setup.py sdist bdist_wheel
421405

422406
[testenv:release-base]
423407
basepython = python3
424408
skip_install = true
425-
deps =
426-
{[testenv:build]deps}
427-
twine
409+
deps = -rdev_requirements/release-requirements.txt
428410
passenv =
429411
# Intentionally omit TWINE_REPOSITORY_URL from the passenv list,
430412
# as this overrides other ways of setting the repository and could

0 commit comments

Comments
 (0)