Skip to content

Allow minor version upgrades for package requirements - #422

Merged
jfuss merged 2 commits into
aws:developfrom
sanathkr:fixing-version-matching
May 3, 2018
Merged

jfuss merged 2 commits into
aws:developfrom
sanathkr:fixing-version-matching

Conversation

@sanathkr

@sanathkr sanathkr commented May 3, 2018

Copy link
Copy Markdown

Issue #, if available:

Description of changes:
According to PEP440, ~= operator will do setup a prefix matching of the last version number. So
pkg~=1.1.0 will allow only patch version upgrades, while pkg~=1.1 will
allow all minor version upgrades while preventing major version changes ie. 2.x

This was my intention with an earlier commit but unfortunately I missed the
fine print in PEP440. This is especially important for boto3 because of how
often they release. Users that have any version of v1.5<=boto3<v2.0 should
be compatible with SAM Translator. SAM Translator uses boto3 only to query
the default region configured in their shell. Being compatible with patch
and minor versions allows SAM Translator to be installable in computers
that have any relatively recent (> Dec 2017) version of AWS CLI. Without
this change, SAM Translator cannot be run on computers with a more recent
version of AWS CLI installation that bundles a recent version of boto3.

This is a good practice in general to allow for easy deployment of security
changes as recommended by PEP404

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sanath Kumar Ramesh added 2 commits May 3, 2018 13:00
According to [PEP440](https://www.python.org/dev/peps/pep-0440/#compatible-release),
`~=` operator will do setup a prefix matching of the last version number. So
`pkg~=1.1.0` will allow only patch version upgrades, while `pkg~=1.1` will
allow all minor version upgrades while preventing major version changes ie. 2.x

This was my intention with an earlier commit but unfortunately I missed the
fine print in PEP440. This is especially important for boto3 because of how
often they release. Users that have any version of v1.5<=boto3<v2.0 should
be compatible with SAM Translator. SAM Translator uses boto3 only to query
the default region configured in their shell. Being compatible with patch
and minor versions allows SAM Translator to be installable in computers
that have any relatively recent (> Dec 2017) version of AWS CLI. Without
this change, SAM Translator cannot be run on computers with a more recent
version of AWS CLI installation that bundles a recent version of boto3.

This is a good practice in general to allow for easy deployment of security
changes as recommended by [PEP404](https://www.python.org/dev/peps/pep-0440/#version-matching)

@jfuss jfuss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This times the charm? :P

@jfuss
jfuss merged commit 0ead344 into aws:develop May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants