Bug fix: Follow only dependencies of current platform #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 4900c7c introduced a feature which makes generate_hashes to
generate the hashes of all the available wheel packages for a
distribution. Revert that feature, because it has two problems:
Prequ is meant to compile the dependencies for just a single
platform, the current one. Hashes for any other platform shouldn't
be in the generated txt file.
It broke the PackageFinder so that the dependencies aren't resolved
for the current platform, but for a magical "can install anything"
platform and ended up generating incorrect dependency tree. See the
example below.
Here's an example that demonstrates why dependencies should be followed
for the current platform rather than accepting any wheel package:
Suppose you have "cryptography" in your source requirements and you're
compiling the requirements for Python 2.7. The newest version of
cryptography is currently 2.0.3 which has wheels for Python 2 and 3.
The Python 3 wheel of cryptography==2.0.3 requires asn1crypto>=0.21.0,
cffi>=1.7, idna>=2.1 and six>=1.4.1, but the Python 2 wheel requires
asn1crypto>=0.21.0, cffi>=1.7, enum34, idna>=2.1, ipaddress and
six>=1.4.1. If the Python 3 wheel is used to resolve the dependencies,
then enum34 or ipaddress will not be added to the dependency tree, since
they are not its dependencies. Therefore it's essential to use the
Python 2 wheel when resolving dependencies for Python 2 platform,
otherwise the enum34 and ipaddress will not be pinned in the generated
txt file as they should.