Skip to content

Commit c436eea

Browse files
danielkzarussellballestrini
authored andcommitted
Update setup dependencies and remove pinnings (#712)
* setup: update dependencies and remove pinnings * setup: add "testing" extras label to help with local testing It's much easier to install test dependencies locally by doing `pip install -e .[testing]` instead of having to manually copy and paste the list from setup.py.
1 parent 3f97c9f commit c436eea

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ lint:
88
flake8 --require-code --min-version=2.7 --ignore FI50,FI51,FI53,FI14,E402,N802,W605 stacker/tests # ignore setUp naming
99

1010
test-unit: clean
11-
AWS_ACCESS_KEY_ID=x AWS_SECRET_ACCESS_KEY=x AWS_DEFAULT_REGION=us-east-1 python setup.py nosetests
11+
python setup.py nosetests
1212

1313
test-unit3: clean
14-
AWS_ACCESS_KEY_ID=x AWS_SECRET_ACCESS_KEY=x AWS_DEFAULT_REGION=us-east-1 python3 setup.py nosetests
14+
python3 setup.py nosetests
1515

1616
clean:
1717
rm -rf .egg stacker.egg-info

setup.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
install_requires = [
1010
"future",
1111
"troposphere>=1.9.0",
12-
# pinning needed till https://github.com/spulec/moto/issues/1924 is
13-
# resolved
14-
"botocore<1.11.0",
15-
"boto3>=1.7.0,<1.8.0",
12+
"botocore",
13+
"boto3>=1.9.111<2.0",
1614
"PyYAML>=3.13b1",
1715
"awacs>=0.6.0",
1816
"gitpython>=2.0,<3.0",
@@ -23,11 +21,8 @@
2321
]
2422

2523
tests_require = [
26-
# pinning needed till https://github.com/spulec/moto/issues/1924 is
27-
# resolved
28-
"aws-xray-sdk==1.1.2",
2924
"mock~=2.0.0",
30-
"moto~=1.1.24",
25+
"moto~=1.3.7",
3126
"testfixtures~=4.10.0",
3227
"coverage~=4.3.4",
3328
"flake8-future-import",
@@ -64,6 +59,7 @@ def read(filename):
6459
install_requires=install_requires,
6560
tests_require=tests_require,
6661
setup_requires=setup_requires,
62+
extras_require=dict(testing=tests_require),
6763
test_suite="nose.collector",
6864
classifiers=[
6965
"Development Status :: 5 - Production/Stable",

stacker/tests/__init__.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
from __future__ import absolute_import, division, print_function
2+
3+
import logging
4+
import os
5+
6+
7+
logger = logging.getLogger(__name__)
8+
_saved_env = {}
9+
10+
11+
def setUpModule():
12+
# Handle change in https://github.com/spulec/moto/issues/1924
13+
# Ensure AWS SDK find some (bogus) credentials in the environment and
14+
# doesn't try to use other providers
15+
overrides = {
16+
'AWS_ACCESS_KEY_ID': 'testing',
17+
'AWS_SECRET_ACCESS_KEY': 'testing',
18+
'AWS_DEFAULT_REGION': 'us-east-1'
19+
}
20+
for key, value in overrides.items():
21+
logger.info('Overriding env var: {}={}'.format(key, value))
22+
_saved_env[key] = os.environ.get(key, None)
23+
os.environ[key] = value
24+
25+
26+
def tearDownModule():
27+
for key, value in _saved_env.items():
28+
logger.info('Restoring saved env var: {}={}'.format(key, value))
29+
if value is None:
30+
del os.environ[key]
31+
else:
32+
os.environ[key] = value
33+
34+
_saved_env.clear()

0 commit comments

Comments
 (0)