Skip to content

Commit 2fd4f9c

Browse files
committed
Move development dependencies out to separate install script
1 parent de5b5ff commit 2fd4f9c

File tree

4 files changed

+60
-13
lines changed

4 files changed

+60
-13
lines changed

requirements-dev.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
nose==1.3.3
2+
wheel==0.37.0
3+
coverage==5.5
4+
5+
# Pytest specific deps
6+
pytest==6.2.5
7+
pytest-cov==2.12.1
8+
atomicwrites>=1.0 # Windows requirement
9+
colorama>0.3.0 # Windows requirement

requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
-e git://github.com/boto/botocore.git@develop#egg=botocore
22
-e git://github.com/boto/jmespath.git@develop#egg=jmespath
33
-e git://github.com/boto/s3transfer.git@develop#egg=s3transfer
4-
nose==1.3.3
5-
mock==1.3.0
6-
wheel==0.24.0

scripts/ci/install

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
#!/usr/bin/env python
22
import os
3-
import sys
4-
from subprocess import check_call
53
import shutil
4+
from contextlib import contextmanager
5+
from subprocess import check_call
66

77
_dname = os.path.dirname
88

99
REPO_ROOT = _dname(_dname(_dname(os.path.abspath(__file__))))
10-
os.chdir(REPO_ROOT)
10+
11+
12+
@contextmanager
13+
def cd(path):
14+
"""Change directory while inside context manager."""
15+
cwd = os.getcwd()
16+
try:
17+
os.chdir(path)
18+
yield
19+
finally:
20+
os.chdir(cwd)
1121

1222

1323
def run(command):
1424
return check_call(command, shell=True)
1525

16-
run('pip install -r requirements.txt')
17-
run('pip install coverage')
18-
if os.path.isdir('dist') and os.listdir('dist'):
19-
shutil.rmtree('dist')
20-
run('python setup.py bdist_wheel')
21-
wheel_dist = os.listdir('dist')[0]
22-
run('pip install %s' % (os.path.join('dist', wheel_dist)))
26+
27+
if __name__ == "__main__":
28+
with cd(REPO_ROOT):
29+
run("pip install -r requirements.txt")
30+
run("python scripts/ci/install-dev-deps")
31+
if os.path.isdir("dist") and os.listdir("dist"):
32+
shutil.rmtree("dist")
33+
run("python setup.py bdist_wheel")
34+
wheel_dist = os.listdir("dist")[0]
35+
run("pip install %s" % (os.path.join("dist", wheel_dist)))

scripts/ci/install-dev-deps

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python
2+
import os
3+
from contextlib import contextmanager
4+
from subprocess import check_call
5+
6+
_dname = os.path.dirname
7+
8+
REPO_ROOT = _dname(_dname(_dname(os.path.abspath(__file__))))
9+
10+
11+
@contextmanager
12+
def cd(path):
13+
"""Change directory while inside context manager."""
14+
cwd = os.getcwd()
15+
try:
16+
os.chdir(path)
17+
yield
18+
finally:
19+
os.chdir(cwd)
20+
21+
22+
def run(command):
23+
return check_call(command, shell=True)
24+
25+
26+
if __name__ == "__main__":
27+
with cd(REPO_ROOT):
28+
run("pip install -r requirements-dev-lock.txt")

0 commit comments

Comments
 (0)