Skip to content

Commit 5643cec

Browse files
author
Lukas Puehringer
committed
build: pin test requirements for deterministic CI
Configures tox to use a pinned requirements file for deterministic CI builds, i.e. our CI shouldn't start failing because of an incompatible upstream release of any of our testing tools: NOTE: pinned tuf runtime requirements were already were already used for test builds before (included via `-r requirements-pinned.txt` in 'requirements-test.txt'). Now they are explicitly listed in 'requirements-test-pinnned.txt'. 'requirements-test-pinnned.txt' was generated semi-automatically by running pip-compile over 'requirements-test.txt' for each supported/tested Python version (see snippet below) and manually merging the resulting per-Python version requirements files into one, adding environment markers as needed. ``` for ver in 3.7.12 3.8.12 3.9.9 3.10.0; do pyenv virtualenv ${ver} tuf-env-${ver} pyenv activate tuf-env-${ver} python3 -m pip install -U pip pip-tools pip-compile --no-header --annotation-style line \ -o requirements-test-pinned-${ver}.txt \ requirements-test.txt pyenv deactivate pyenv uninstall -f tuf-env-${ver} done ``` Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
1 parent 8ec45dc commit 5643cec

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

requirements-test-pinned.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
astroid==2.9.3 # via pylint
2+
bandit==1.7.2 # via -r requirements-test.txt
3+
black==22.1.0 # via -r requirements-test.txt
4+
certifi==2021.10.8 # via -r requirements-pinned.txt, requests
5+
cffi==1.15.0 # via -r requirements-pinned.txt, cryptography, pynacl
6+
charset-normalizer==2.0.12 # via -r requirements-pinned.txt, requests
7+
click==8.0.3 # via black
8+
coverage==6.3.1 # via -r requirements-test.txt
9+
cryptography==36.0.1 # via -r requirements-pinned.txt, securesystemslib
10+
gitdb==4.0.9 # via gitpython
11+
gitpython==3.1.26 # via bandit
12+
idna==3.3 # via -r requirements-pinned.txt, requests
13+
importlib-metadata==4.11.1; python_version < '3.8' # via click, stevedore
14+
isort==5.10.1 # via -r requirements-test.txt, pylint
15+
lazy-object-proxy==1.7.1 # via astroid
16+
mccabe==0.6.1 # via pylint
17+
mypy==0.931 # via -r requirements-test.txt
18+
mypy-extensions==0.4.3 # via black, mypy
19+
pathspec==0.9.0 # via black
20+
pbr==5.8.1 # via stevedore
21+
platformdirs==2.5.0 # via black, pylint
22+
pycparser==2.21 # via -r requirements-pinned.txt, cffi
23+
pylint==2.12.2 # via -r requirements-test.txt
24+
pynacl==1.5.0 # via -r requirements-pinned.txt, securesystemslib
25+
pyyaml==6.0 # via bandit
26+
requests==2.27.1 # via -r requirements-pinned.txt
27+
securesystemslib[crypto,pynacl]==0.22.0 # via -r requirements-pinned.txt
28+
smmap==5.0.0 # via gitdb
29+
stevedore==3.5.0 # via bandit
30+
toml==0.10.2 # via pylint
31+
tomli==2.0.1 # via black, mypy
32+
typed-ast==1.5.2; python_version < '3.8' # via astroid, black, mypy
33+
types-requests==2.27.9 # via -r requirements-test.txt
34+
types-urllib3==1.26.9 # via types-requests
35+
typing-extensions==4.1.1 # via astroid, black, gitpython, importlib-metadata, mypy, pylint
36+
urllib3==1.26.8 # via -r requirements-pinned.txt, requests
37+
wrapt==1.13.3 # via astroid
38+
zipp==3.7.0; python_version < '3.8' # via importlib-metadata
39+
40+
# The following packages are considered to be unsafe in a requirements file:
41+
# setuptools

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ commands =
1919
python3 -m coverage report -m --fail-under 97
2020

2121
deps =
22-
-r{toxinidir}/requirements-test.txt
22+
-r{toxinidir}/requirements-test-pinned.txt
2323
# Install TUF in editable mode, instead of tox default virtual environment
2424
# installation (see `skipsdist`), to get relative paths in coverage reports
2525
--editable {toxinidir}

0 commit comments

Comments
 (0)