Commit 68e1aae3 by Sébastien Eustace

Fix dependencies being installed even if not necessary for current system

parent 617a98c5
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
- Fixed `add` command picking up prereleases by default. - Fixed `add` command picking up prereleases by default.
- Fixed dependendency resolution on Windows when unpacking distributions. - Fixed dependendency resolution on Windows when unpacking distributions.
- Fixed dependency resolution with post releases. - Fixed dependency resolution with post releases.
- Fixed dependencies being installed even if not necessary for current system.
## [0.8.1] - 2018-04-13 ## [0.8.1] - 2018-04-13
......
...@@ -455,6 +455,10 @@ class Installer: ...@@ -455,6 +455,10 @@ class Installer:
op.skip('Not needed for the current python version') op.skip('Not needed for the current python version')
continue continue
if not package.python_constraint.matches(Constraint('=', python)):
op.skip('Not needed for the current python version')
continue
if 'platform' in package.requirements: if 'platform' in package.requirements:
platform_constraint = GenericConstraint.parse( platform_constraint = GenericConstraint.parse(
package.requirements['platform'] package.requirements['platform']
...@@ -466,6 +470,12 @@ class Installer: ...@@ -466,6 +470,12 @@ class Installer:
op.skip('Not needed for the current platform') op.skip('Not needed for the current platform')
continue continue
if not package.platform_constraint.matches(
GenericConstraint('=', sys.platform)
):
op.skip('Not needed for the current platform')
continue
if self._update: if self._update:
extras = {} extras = {}
for extra, deps in self._package.extras.items(): for extra, deps in self._package.extras.items():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment