Skip to content

Commit d1487d3

Browse files
committed
Pin build dependencies and configure dependabot (aws#389)
* chore: Pin build dependencies and configure dependabot * Ignore flake8 document linting on tests * Unpin decrypt_oracle dependencies for now * Pin tox * Isolate pinned dependencies to dev_requirements dir
1 parent c067b79 commit d1487d3

14 files changed

+75
-48
lines changed

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
# master
4+
- package-ecosystem: "pip"
5+
directory: "/dev_requirements"
6+
schedule:
7+
interval: "daily"
8+
9+
# mainline-1.x
10+
- package-ecosystem: "pip"
11+
directory: "/dev_requirements"
12+
schedule:
13+
interval: "daily"
14+
target-branch: "mainline-1.x"
15+
16+
# mainline-2.x
17+
- package-ecosystem: "pip"
18+
directory: "/dev_requirements"
19+
schedule:
20+
interval: "daily"
21+
target-branch: "mainline-2.x"
22+
23+
# Github Actions
24+
- package-ecosystem: "github-actions"
25+
directory: "/"
26+
schedule:
27+
interval: "daily"

.github/workflows/ci_decrypt-oracle.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: 3.6
1919
- run: |
2020
python -m pip install --upgrade pip
21-
pip install --upgrade -r ci-requirements.txt
21+
pip install --upgrade -r dev_requirements/ci-requirements.txt
2222
- name: run test
2323
env:
2424
TOXENV: local
@@ -44,7 +44,7 @@ jobs:
4444
python-version: 3.8
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 }}

.github/workflows/ci_static-analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python-version: 3.8
3434
- run: |
3535
python -m pip install --upgrade pip
36-
pip install --upgrade -r ci-requirements.txt
36+
pip install --upgrade -r dev_requirements/ci-requirements.txt
3737
- name: run test
3838
env:
3939
TOXENV: ${{ matrix.category }}

.github/workflows/ci_test-vector-handler.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
architecture: ${{ matrix.architecture }}
5454
- run: |
5555
python -m pip install --upgrade pip
56-
pip install --upgrade -r ci-requirements.txt
56+
pip install --upgrade -r dev_requirements/ci-requirements.txt
5757
- name: run test
5858
env:
5959
TOXENV: ${{ matrix.category }}
@@ -79,7 +79,7 @@ jobs:
7979
python-version: 3.8
8080
- run: |
8181
python -m pip install --upgrade pip
82-
pip install --upgrade -r ci-requirements.txt
82+
pip install --upgrade -r dev_requirements/ci-requirements.txt
8383
- name: run test
8484
env:
8585
TOXENV: ${{ matrix.category }}

.github/workflows/ci_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
architecture: ${{ matrix.architecture }}
6060
- run: |
6161
python -m pip install --upgrade pip
62-
pip install --upgrade -r ci-requirements.txt
62+
pip install --upgrade -r dev_requirements/ci-requirements.txt
6363
- name: run test
6464
env:
6565
TOXENV: ${{ matrix.category }}
@@ -79,7 +79,7 @@ jobs:
7979
python-version: 3.7
8080
- run: |
8181
python -m pip install --upgrade pip
82-
pip install --upgrade -r ci-requirements.txt
82+
pip install --upgrade -r dev_requirements/ci-requirements.txt
8383
- name: run test
8484
env:
8585
TOXENV: ${{ matrix.category }}

ci-requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev_requirements/ci-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tox==3.24.4
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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-print==4.0.0
8+
isort==5.10.1
9+
pyflakes==2.4.0
10+
pylint==2.12.2
11+
readme_renderer==32.0
12+
seed-isort-config==2.2.0
13+
vulture==2.3
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pypi-parker==0.1.2
2+
setuptools==59.6.0
3+
twine==3.7.1
4+
wheel==0.37.0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mock==4.0.3
2+
pytest==6.2.5
3+
pytest-cov==3.0.0
4+
pytest-mock==3.6.1

test/freeze-upstream-requirements.sh

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 4 deletions
This file was deleted.

tox.ini

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ passenv =
6161
# Pass through custom pip config file settings
6262
PIP_CONFIG_FILE
6363
sitepackages = False
64-
deps = -rtest/requirements.txt
64+
deps = -rdev_requirements/test-requirements.txt
6565
commands =
6666
local: {[testenv:base-command]commands} test/ -m local
6767
integ: {[testenv:base-command]commands} test/ -m integ
@@ -83,7 +83,7 @@ sitepackages = False
8383
passenv =
8484
setenv =
8585
#########################################################
86-
deps = -rtest/requirements.txt
86+
deps = -rdev_requirements/test-requirements.txt
8787
commands = {[testenv:base-command]commands} test/ -m local
8888

8989
# Collect requirements for use in upstream tests
@@ -137,27 +137,19 @@ commands = {[testenv:test-upstream-requirements-base]commands}
137137
# Linters
138138
[testenv:flake8]
139139
basepython = python3
140-
deps =
141-
flake8
142-
flake8-docstrings>=1.5.0
143-
# https://github.com/JBKahn/flake8-print/pull/30
144-
flake8-print>=3.1.0
145-
flake8-bugbear
140+
deps = -rdev_requirements/linter-requirements.txt
146141
commands =
147142
flake8 src/aws_encryption_sdk/ setup.py
148143

149144
[testenv:flake8-tests]
150145
basepython = {[testenv:flake8]basepython}
151-
deps =
152-
flake8
153-
# https://github.com/JBKahn/flake8-print/pull/30
154-
flake8-print>=3.1.0
146+
deps = -rdev_requirements/linter-requirements.txt
155147
commands =
156148
flake8 \
157149
# Ignore F811 redefinition errors in tests (breaks with pytest-mock use)
158150
# E203 is not PEP8 compliant https://github.com/ambv/black#slices
159151
# W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators
160-
--ignore F811,E203,W503 \
152+
--ignore F811,E203,W503,D \
161153
test/
162154

163155
[testenv:flake8-examples]
@@ -176,8 +168,7 @@ commands =
176168
basepython = python3
177169
deps =
178170
{[testenv]deps}
179-
pyflakes
180-
pylint
171+
-rdev_requirements/linter-requirements.txt
181172
commands =
182173
pylint \
183174
--rcfile=src/pylintrc \
@@ -204,8 +195,7 @@ commands =
204195

205196
[testenv:blacken-src]
206197
basepython = python3
207-
deps =
208-
black
198+
deps = -rdev_requirements/linter-requirements.txt
209199
commands =
210200
black --line-length 120 \
211201
src/aws_encryption_sdk/ \
@@ -232,12 +222,12 @@ commands =
232222

233223
[testenv:isort-seed]
234224
basepython = python3
235-
deps = seed-isort-config
225+
deps = -rdev_requirements/linter-requirements.txt
236226
commands = seed-isort-config
237227

238228
[testenv:isort]
239229
basepython = python3
240-
deps = isort
230+
deps = -rdev_requirements/linter-requirements.txt
241231
commands = isort -rc \
242232
src \
243233
test \
@@ -264,25 +254,24 @@ commands =
264254
[testenv:doc8]
265255
basepython = python3
266256
deps =
267-
sphinx
268-
doc8
257+
-rdev_requirements/linter-requirements.txt
258+
-rdev_requirements/doc-requirements.txt
269259
commands = doc8 doc/index.rst README.rst CHANGELOG.rst
270260

271261
[testenv:readme]
272262
basepython = python3
273-
deps = readme_renderer
263+
deps = -rdev_requirements/linter-requirements.txt
274264
commands = python setup.py check -r -s
275265

276266
[testenv:bandit]
277267
basepython = python3
278-
deps =
279-
bandit>=1.5.1
268+
deps = -rdev_requirements/linter-requirements.txt
280269
commands = bandit -r src/aws_encryption_sdk/
281270

282271
# Prone to false positives: only run independently
283272
[testenv:vulture]
284273
basepython = python3
285-
deps = vulture
274+
deps = -rdev_requirements/linter-requirements.txt
286275
commands = vulture src/aws_encryption_sdk/
287276

288277
[testenv:linters]
@@ -321,7 +310,7 @@ commands =
321310
# Documentation
322311
[testenv:docs]
323312
basepython = python3
324-
deps = -rdoc/requirements.txt
313+
deps = -rdev_requirements/doc-requirements.txt
325314
commands =
326315
sphinx-build -E -c doc/ -b html doc/ doc/build/html
327316

@@ -337,26 +326,20 @@ commands =
337326
[testenv:park]
338327
basepython = python3.6
339328
skip_install = true
340-
deps =
341-
pypi-parker
342-
setuptools
329+
deps = -rdev_requirements/release-requirements.txt
343330
commands = python setup.py park
344331

345332
[testenv:build]
346333
basepython = python3
347334
skip_install = true
348-
deps =
349-
wheel
350-
setuptools
335+
deps = -rdev_requirements/release-requirements.txt
351336
commands =
352337
python setup.py sdist bdist_wheel
353338

354339
[testenv:release-base]
355340
basepython = python3
356341
skip_install = true
357-
deps =
358-
{[testenv:build]deps}
359-
twine
342+
deps = -rdev_requirements/release-requirements.txt
360343
passenv =
361344
# Intentionally omit TWINE_REPOSITORY_URL from the passenv list,
362345
# as this overrides other ways of setting the repository and could

0 commit comments

Comments
 (0)