Skip to content

Commit 6ce11cb

Browse files
feature: dependabot integ - move all deps to requirements.txt (#2981)
1 parent 0502274 commit 6ce11cb

14 files changed

+70
-58
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
recursive-include src/sagemaker *.py
22

33
include src/sagemaker/image_uri_config/*.json
4+
recursive-include requirements *
45

56
include VERSION
67
include LICENSE.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
urllib3==1.26.8
2+
docker-compose==1.29.2
3+
docker~=5.0.0
4+
PyYAML==5.4.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scipy==1.5.4
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
tox==3.24.5
2+
flake8==4.0.1
3+
pytest==6.0.2
4+
pytest-cov==3.0.0
5+
pytest-rerunfailures==10.2
6+
pytest-timeout==2.1.0
7+
pytest-xdist==2.4.0
8+
coverage>=5.2, <6.2
9+
mock==4.0.3
10+
contextlib2==21.6.0
11+
awslogs==0.14.0
12+
black==22.3.0
13+
stopit==1.1.2
14+
apache-airflow==2.2.4
15+
apache-airflow-providers-amazon==3.0.0
16+
attrs==20.3.0
17+
fabric==2.6.0
18+
requests==2.27.1
19+
sagemaker-experiments==0.1.35
20+
Jinja2==3.0.3
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
doc8==0.10.1
2+
Pygments==2.11.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pydocstyle==6.1.1
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flake8==4.0.1
2+
flake8-future-import==0.4.6
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mypy==0.942
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pydocstyle==6.1.1
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pylint==2.6.2
2+
astroid==2.4.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyenchant==3.2.2
2+
pylint==2.6.2
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
twine==3.8.0

setup.py

+18-32
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ def read_version():
3131
return read("VERSION").strip()
3232

3333

34+
def read_requirements(filename):
35+
"""Reads requirements file which lists package dependencies.
36+
37+
Args:
38+
filename: type(str) Relative file path of requirements.txt file
39+
40+
Returns:
41+
list of dependencies extracted from file
42+
"""
43+
with open(os.path.abspath(filename)) as fp:
44+
deps = [line.strip() for line in fp.readlines()]
45+
return deps
46+
47+
3448
# Declare minimal set for installation
3549
required_packages = [
3650
"attrs==20.3.0",
@@ -47,43 +61,15 @@ def read_version():
4761
]
4862

4963
# Specific use case dependencies
64+
# Keep format of *_requirements.txt to be tracked by dependabot
5065
extras = {
51-
"local": [
52-
"urllib3==1.26.8",
53-
"docker-compose==1.29.2",
54-
"docker~=5.0.0",
55-
"PyYAML==5.4.1", # PyYAML version has to match docker-compose requirements
56-
],
57-
"scipy": ["scipy==1.5.4"],
66+
"local": read_requirements("requirements/extras/local_requirements.txt"),
67+
"scipy": read_requirements("requirements/extras/scipy_requirements.txt"),
5868
}
5969
# Meta dependency groups
6070
extras["all"] = [item for group in extras.values() for item in group]
6171
# Tests specific dependencies (do not need to be included in 'all')
62-
extras["test"] = (
63-
[
64-
extras["all"],
65-
"tox==3.24.5",
66-
"flake8==4.0.1",
67-
"pytest==6.0.2",
68-
"pytest-cov==3.0.0",
69-
"pytest-rerunfailures==10.2",
70-
"pytest-timeout==2.1.0",
71-
"pytest-xdist==2.4.0",
72-
"coverage>=5.2, <6.2",
73-
"mock==4.0.3",
74-
"contextlib2==21.6.0",
75-
"awslogs==0.14.0",
76-
"black==22.1.0",
77-
"stopit==1.1.2",
78-
"apache-airflow==2.2.3",
79-
"apache-airflow-providers-amazon==3.0.0",
80-
"attrs==20.3.0",
81-
"fabric==2.6.0",
82-
"requests==2.27.1",
83-
"sagemaker-experiments==0.1.35",
84-
"Jinja2==3.0.3",
85-
],
86-
)
72+
extras["test"] = (extras["all"] + read_requirements("requirements/extras/test_requirements.txt"),)
8773

8874
setup(
8975
name="sagemaker",

tox.ini

+14-26
Original file line numberDiff line numberDiff line change
@@ -79,62 +79,51 @@ depends =
7979
[testenv:flake8]
8080
skipdist = true
8181
skip_install = true
82-
deps =
83-
flake8==4.0.1
84-
flake8-future-import==0.4.6
85-
commands = flake8
82+
commands =
83+
pip install --exists-action=w -r requirements/tox/flake8_requirements.txt
84+
flake8
8685

8786
[testenv:pylint]
8887
skipdist = true
8988
skip_install = true
90-
deps =
91-
pylint==2.6.2
92-
astroid==2.4.2
9389
commands =
90+
pip install --exists-action=w -r requirements/tox/pylint_requirements.txt
9491
python -m pylint --rcfile=.pylintrc -j 0 src/sagemaker
9592

9693
[testenv:spelling]
9794
skipdist = true
9895
skip_install = true
99-
deps =
100-
pyenchant
101-
pylint
10296
commands =
97+
pip install --exists-action=w -r requirements/tox/spelling_requirements.txt
10398
python -m pylint --rcfile=.pylintrc --disable all --enable spelling --spelling-dict en_US src/sagemaker/{posargs}
10499

105100
[testenv:twine]
106-
# twine check was added starting in 1.12.0
107-
# https://github.com/pypa/twine/blob/master/docs/changelog.rst
108-
deps =
109-
twine==3.8.0
110101
# https://packaging.python.org/guides/making-a-pypi-friendly-readme/#validating-restructuredtext-markup
111102
commands =
103+
pip install --exists-action=w -r requirements/tox/twine_requirements.txt
112104
python setup.py sdist
113105
twine check dist/*.tar.gz
114106

115107
[testenv:sphinx]
108+
pip_version = pip==21.3
116109
changedir = doc
117110
# pip install requirements.txt is separate as RTD does it in separate steps
118111
# having the requirements.txt installed in deps above results in Double Requirement exception
119112
# https://github.com/pypa/pip/issues/988
120-
deps =
121-
pip==21.3
122113
commands =
123114
pip install --exists-action=w -r requirements.txt
124115
sphinx-build -T -W -b html -d _build/doctrees-readthedocs -D language=en . _build/html
125116

126117
[testenv:doc8]
127-
deps =
128-
doc8==0.10.1
129-
Pygments==2.11.2
130-
commands = doc8
118+
commands =
119+
pip install --exists-action=w -r requirements/tox/doc8_requirements.txt
120+
doc8
131121

132122
[testenv:black-format]
133123
# Used during development (before committing) to format .py files.
134124
setenv =
135125
LC_ALL=C.UTF-8
136126
LANG=C.UTF-8
137-
deps = black==22.3.0
138127
commands =
139128
black -l 100 ./
140129

@@ -143,23 +132,22 @@ commands =
143132
setenv =
144133
LC_ALL=C.UTF-8
145134
LANG=C.UTF-8
146-
deps = black==22.3.0
147135
commands =
148136
black -l 100 --check ./
149137

150138
[testenv:clean]
151-
deps = coverage==6.2
152139
skip_install = true
153-
commands = coverage erase
140+
commands =
141+
coverage erase
154142

155143
[testenv:typing]
156-
deps = mypy
157144
commands =
145+
pip install --exists-action=w -r requirements/tox/mypy_requirements.txt
158146
mypy src/sagemaker
159147

160148
[testenv:docstyle]
161-
deps = pydocstyle==6.1.1
162149
commands =
150+
pip install --exists-action=w -r requirements/tox/pydocstyle_requirements.txt
163151
pydocstyle src/sagemaker
164152

165153
[testenv:collect-tests]

0 commit comments

Comments
 (0)