From 5b576de83ac13912cf30093b3a2247b05c9b9669 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Tue, 28 Aug 2018 22:26:28 +0200 Subject: [PATCH 1/2] fix handling of direct URL specifiers in requirements Do not strip the URLs. Fix #249. --- tests/test_metadata.py | 3 +++ wheel/metadata.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 34214302..78fe40db 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -9,6 +9,7 @@ def test_pkginfo_to_metadata(tmpdir): ('Provides-Extra', 'test'), ('Provides-Extra', 'signatures'), ('Provides-Extra', 'faster-signatures'), + ('Requires-Dist', "pip @ https://github.com/pypa/pip/archive/1.3.1.zip"), ('Requires-Dist', "ed25519ll; extra == 'faster-signatures'"), ('Requires-Dist', "keyring; extra == 'signatures'"), ('Requires-Dist', "keyrings.alt; extra == 'signatures'"), @@ -28,6 +29,8 @@ def test_pkginfo_to_metadata(tmpdir): egg_info_dir = tmpdir.ensure_dir('test.egg-info') egg_info_dir.join('requires.txt').write("""\ +pip@https://github.com/pypa/pip/archive/1.3.1.zip + [faster-signatures] ed25519ll diff --git a/wheel/metadata.py b/wheel/metadata.py index 4fa17cde..74c6abc1 100644 --- a/wheel/metadata.py +++ b/wheel/metadata.py @@ -16,7 +16,9 @@ def requires_to_requires_dist(requirement): - """Compose the version predicates for requirement in PEP 345 fashion.""" + """Return the version specifier for a requirement in PEP 345/566 fashion.""" + if requirement.url: + return " @ " + requirement.url requires_dist = [] for op, ver in requirement.specs: requires_dist.append(op + ver) From 3a13f000de80ff2a5d1905d850e676afcc63a8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sun, 23 Sep 2018 19:08:01 +0300 Subject: [PATCH 2/2] Added empty line after if block --- wheel/metadata.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wheel/metadata.py b/wheel/metadata.py index 74c6abc1..c6a37364 100644 --- a/wheel/metadata.py +++ b/wheel/metadata.py @@ -19,6 +19,7 @@ def requires_to_requires_dist(requirement): """Return the version specifier for a requirement in PEP 345/566 fashion.""" if requirement.url: return " @ " + requirement.url + requires_dist = [] for op, ver in requirement.specs: requires_dist.append(op + ver)