Skip to content

Pin build dependencies and configure dependabot #389

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 5 commits into from
Dec 17, 2021
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
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
updates:
# master
- package-ecosystem: "pip"
directory: "/dev_requirements"
schedule:
interval: "daily"

# mainline-1.x
- package-ecosystem: "pip"
directory: "/dev_requirements"
schedule:
interval: "daily"
target-branch: "mainline-1.x"

# mainline-2.x
- package-ecosystem: "pip"
directory: "/dev_requirements"
schedule:
interval: "daily"
target-branch: "mainline-2.x"
Comment on lines +9 to +21
Copy link
Contributor

Choose a reason for hiding this comment

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

Err... what happens when dev_requirements does not yet exist? I assume an error... you may want to remove these until we back port dev_requirements to the other branches.

NVM: Dependabot will probably just not find anything, and move on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah when I tested this on my fork dependbot just shrugged for whichever targets it didn't find. It will "just work" as soon as those branches are correctly updated.


# Github Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
4 changes: 2 additions & 2 deletions .github/workflows/ci_decrypt-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: 3.6
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: local
Expand All @@ -44,7 +44,7 @@ jobs:
python-version: 3.8
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python-version: 3.8
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_test-vector-handler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
architecture: ${{ matrix.architecture }}
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
Expand All @@ -78,7 +78,7 @@ jobs:
python-version: 3.8
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
architecture: ${{ matrix.architecture }}
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
Expand All @@ -77,7 +77,7 @@ jobs:
python-version: 3.7
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
pip install --upgrade -r dev_requirements/ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
Expand Down
1 change: 0 additions & 1 deletion ci-requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions dev_requirements/ci-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tox==3.24.4
File renamed without changes.
13 changes: 13 additions & 0 deletions dev_requirements/linter-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
4 changes: 4 additions & 0 deletions dev_requirements/release-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pypi-parker==0.1.2
setuptools==59.6.0
twine==3.7.1
wheel==0.37.0
4 changes: 4 additions & 0 deletions dev_requirements/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mock==4.0.3
pytest==6.2.5
pytest-cov==3.0.0
pytest-mock==3.6.1
2 changes: 1 addition & 1 deletion test/freeze-upstream-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ if [ -z ${1} ]; then
fi

pip install -r requirements.txt
pip install -r test/requirements.txt
pip install -r dev_requirements/test-requirements.txt
pip freeze > ${1}
4 changes: 0 additions & 4 deletions test/requirements.txt

This file was deleted.

53 changes: 18 additions & 35 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ passenv =
# Pass through custom pip config file settings
PIP_CONFIG_FILE
sitepackages = False
deps = -rtest/requirements.txt
deps = -rdev_requirements/test-requirements.txt
commands =
local: {[testenv:base-command]commands} test/ -m local
integ: {[testenv:base-command]commands} test/ -m integ
Expand All @@ -83,7 +83,7 @@ sitepackages = False
passenv =
setenv =
#########################################################
deps = -rtest/requirements.txt
deps = -rdev_requirements/test-requirements.txt
commands = {[testenv:base-command]commands} test/ -m local

# Collect requirements for use in upstream tests
Expand Down Expand Up @@ -120,27 +120,19 @@ commands = {[testenv:test-upstream-requirements-base]commands}
# Linters
[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
deps = -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
deps = -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 \
--ignore F811,E203,W503,D \
test/

[testenv:flake8-examples]
Expand All @@ -159,8 +151,7 @@ commands =
basepython = python3
deps =
{[testenv]deps}
pyflakes
pylint
-rdev_requirements/linter-requirements.txt
commands =
pylint \
--rcfile=src/pylintrc \
Expand All @@ -187,8 +178,7 @@ commands =

[testenv:blacken-src]
basepython = python3
deps =
black
deps = -rdev_requirements/linter-requirements.txt
commands =
black --line-length 120 \
src/aws_encryption_sdk/ \
Expand All @@ -215,12 +205,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 @@ -247,25 +237,24 @@ commands =
[testenv:doc8]
basepython = python3
deps =
sphinx
doc8
-rdev_requirements/linter-requirements.txt
-rdev_requirements/doc-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 Expand Up @@ -304,7 +293,7 @@ commands =
# Documentation
[testenv:docs]
basepython = python3
deps = -rdoc/requirements.txt
deps = -rdev_requirements/doc-requirements.txt
commands =
sphinx-build -E -c doc/ -b html doc/ doc/build/html

Expand All @@ -320,26 +309,20 @@ commands =
[testenv:park]
basepython = python3
skip_install = true
deps =
pypi-parker
setuptools
deps = -rdev_requirements/release-requirements.txt
commands = python setup.py park

[testenv:build]
basepython = python3
skip_install = true
deps =
wheel
setuptools
deps = -rdev_requirements/release-requirements.txt
commands =
python setup.py sdist bdist_wheel

[testenv:release-base]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
deps = -rdev_requirements/release-requirements.txt
passenv =
# Intentionally omit TWINE_REPOSITORY_URL from the passenv list,
# as this overrides other ways of setting the repository and could
Expand Down