Skip to content

Commit 0bb8ef7

Browse files
authored
Removing unnecessary dependencies from requirements file (#416)
`boto3`: Many users might have this library already available in thier Python installation from installing the AWS CLI. We use boto3 in only one place, which is to get the region_name from `boto3.session.Session` which hasn't changed since 2016. Updating the requirement to depend on boto3 >=1.5.0 allows us to be compatible with existing installations that might already have an older version of boto3 `botocore, docutils, futures, jmespath, python-dateutil, s3transfer`: These packages are not used in the SAM translator but come as a dependency through boto3. Hence removing the direct dependency. `functools32`: Grepped for every single method offered by this package. We don't use any of it directly within SAM Translator. This might have come as a dependency through boto3. `PyYAML`: Only required by the tests. So moving to dev dependency `six`: Reducing the specificity of version requirement `~=`: Using this operator in order to accept to a compatible minor/patch version but preventing a major version change. **Testing**: - `make pr` and `make test` pass. Built a tar.gz distribution using `python setup.py sdist` and installed it in a clean virtualenv successfully. Tests ran successfully too. I was also able to import
1 parent 98a87f4 commit 0bb8ef7

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

requirements/base.txt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
boto3>=1.6.2
2-
botocore>=1.9.2
3-
docutils==0.14
4-
enum34==1.1.6
5-
functools32==3.2.3.post2
6-
futures==3.2.0
7-
jmespath==0.9.3
8-
jsonschema==2.6.0
9-
python-dateutil==2.6.1
10-
PyYAML==3.12
11-
s3transfer==0.1.13
12-
six==1.11.0
1+
boto3~=1.5.0
2+
enum34~=1.1.6
3+
jsonschema~=2.6.0
4+
six~=1.11.0
5+

requirements/dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ flake8>=3.3.0
33
tox>=2.2.1
44
pytest-cov>=2.4.0
55
pylint>=1.7.2
6+
PyYAML==3.12
67

78
# Test requirements
89
pytest>=3.0.7

0 commit comments

Comments
 (0)