diff options
| author | Steve Kowalik <steven@wedontsleep.org> | 2016-03-01 16:07:42 +1100 |
|---|---|---|
| committer | Steve Kowalik <steven@wedontsleep.org> | 2016-03-01 16:07:42 +1100 |
| commit | 0ed33b7a4db605e4608f56d6bdb5efe81762b4cb (patch) | |
| tree | 935aa03bf0cf0c2a5d8a5fb0f33b737bf3f9557c /setuptools | |
| parent | a46fd8327e5c13b45fcc92322b4fe00a76f307da (diff) | |
| download | python-setuptools-git-0ed33b7a4db605e4608f56d6bdb5efe81762b4cb.tar.gz | |
Shift requirement parsing inside Requirement
Diffstat (limited to 'setuptools')
| -rwxr-xr-x | setuptools/command/easy_install.py | 5 | ||||
| -rw-r--r-- | setuptools/tests/test_dist_info.py | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 08bc9c51..97de3395 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -710,10 +710,7 @@ class easy_install(Command): elif requirement is None or dist not in requirement: # if we wound up with a different version, resolve what we've got distreq = dist.as_requirement() - requirement = requirement or distreq - requirement = Requirement( - distreq.project_name, distreq.specs, requirement.extras - ) + requirement = Requirement(str(distreq.req)) log.info("Processing dependencies for %s", requirement) try: distros = WorkingSet([]).resolve( diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py index 002968a3..9f226a55 100644 --- a/setuptools/tests/test_dist_info.py +++ b/setuptools/tests/test_dist_info.py @@ -34,7 +34,9 @@ class TestDistInfo: for d in pkg_resources.find_distributions(self.tmpdir): assert d.requires() == requires[:1] - assert d.requires(extras=('baz',)) == requires + assert d.requires(extras=('baz',)) == [ + requires[0], + pkg_resources.Requirement.parse('quux>=1.1;extra=="baz"')] assert d.extras == ['baz'] metadata_template = DALS(""" |
