Skip to content

Commit 2e371a1

Browse files
committed
Rename and restructure requirements files
- New/updated requirements files: - requirements.txt: lists all unpinned immedeate runtime requirements (i.e. combines 'install_requires' and 'extras_require' from setup.py) and has instructions on how to create requirements-pinned.txt - requirements-pinned.txt: lists all pinned immedeate and transitive runtime requirements, based on requirements.txt, including environment markers, and is subjected to automatic updates with dependabot - requirements-min.txt: subset of requirements.txt without 'extras_require' (was purepy-requirements.txt). The requirements are not pinned, but updates should still trigger tests, if dependabot changes requirements-pinned.txt, which lists the same dependabots. - requirements-test.txt unpinned test runtime dependencies and test tooling. pinning is not so important there, because the end-user usually doesn't care about those dependencies. - requirements-dev.txt combines other requirements plus additional tooling and an editable install of securesystemslib - Use requirements-`<suffix>`.txt notation instead of `<prefix>`-requirements.txt to group them in file tree view. - Adopt changes in MANIFEST.in and tox.ini
1 parent 6ea3ade commit 2e371a1

10 files changed

+66
-35
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include LICENSE
44
# Add test config files to show how to run tests
55
include tox.ini
66
include .travis.yml
7-
include *requirements.txt
7+
include requirements*.txt
88

99
# Include all files under the tests directory (including test data)
1010
graft tests

ci-requirements.txt

-10
This file was deleted.

dev-requirements.txt

-12
This file was deleted.

purepy-requirements.txt

-7
This file was deleted.

requirements-dev.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Install securesystemslib in editable mode with all runtime and test
2+
# requirements for local testing with tox, and also for the running test suite
3+
# or individual tests manually
4+
tox
5+
-r requirements.txt
6+
-r requirements-test.txt
7+
-e .

requirements-min.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Minimal runtime requirements (see 'install_requires' in setup.py)
2+
six
3+
python-dateutil
4+
subprocess32; python_version < '3'

requirements-pinned.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cffi==1.14.0 # via cryptography, pynacl
2+
colorama==0.4.3
3+
cryptography==2.8
4+
enum34==1.1.6 ; python_version < "3" # via cryptography
5+
ipaddress==1.0.23 ; python_version < "3" # via cryptography
6+
pycparser==2.19 # via cffi
7+
pynacl==1.3.0
8+
python-dateutil==2.8.1
9+
six==1.14.0
10+
subprocess32==3.5.4 ; python_version < "3"

requirements-test.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# test runtime dependencies (see 'tests_require' field in setup.py)
2+
mock; python_version < "3.3"
3+
4+
# additional test tools
5+
coverage

requirements.txt

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1+
# All runtime requirements including extras (see 'install_requires' and
2+
# 'extras_require' in setup.py)
3+
#
4+
# This file together with 'pip-compile' is used to generate a pinned
5+
# requirements file with all immediate and transitive dependencies.
6+
#
7+
# 'requirements-pinned.txt' is updated on GitHub with Dependabot, which
8+
# triggers CI/CD builds to automatically test against updated dependencies.
9+
#
10+
# Below instructions can be used to re-generate 'requirements-pinned.txt', e.g.
11+
# if:
12+
# - requirements are added or removed from this file
13+
# - Python version support is changed
14+
# - CI/CD build breaks due to updates (e.g. transitive dependency conflicts)
15+
#
16+
# 1. Use this script to create a pinned requirements file for each Python
17+
# version
18+
# ```
19+
# for v in 2.7 3.5 3.6 3.7 3.8; do
20+
# mkvirtualenv sslib-env-${v} -p python${v};
21+
# pip install pip-tools;
22+
# pip-compile --no-header -o requirements-${v}.txt requirements.txt;
23+
# deactivate;
24+
# rmvirtualenv sslib-env-${v};
25+
# done;
26+
#
27+
# ```
28+
# 2. Use this command to merge per-version files
29+
# `sort -o requirements-pinned.txt -u requirements-?.?.txt`
30+
# 2. Manually add environment markers to requirements-pinned.txt
31+
# 3. Use this command to remove per-version files
32+
# `rm requirements-?.?.txt`
33+
#
134
cryptography
235
pynacl
3-
six
436
colorama
37+
six
538
python-dateutil
6-
subprocess32; python_version < '3'
39+
subprocess32 ; python_version < '3'

tox.ini

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@ install_command =
1212
pip install --pre {opts} {packages}
1313

1414
deps =
15-
-r{toxinidir}/ci-requirements.txt
15+
-r{toxinidir}/requirements-pinned.txt
16+
-r{toxinidir}/requirements-test.txt
1617

1718
commands =
1819
coverage run tests/aggregate_tests.py
1920
coverage report -m --fail-under 99
2021

2122
[testenv:purepy27]
2223
deps =
23-
-r{toxinidir}/purepy-requirements.txt
24+
-r{toxinidir}/requirements-min.txt
2425

2526
commands =
2627
python -m tests.check_public_interfaces
2728

2829
[testenv:purepy38]
2930
deps =
30-
-r{toxinidir}/purepy-requirements.txt
31+
-r{toxinidir}/requirements-min.txt
3132

3233
commands =
3334
python -m tests.check_public_interfaces

0 commit comments

Comments
 (0)