Commit ff2c39e9 by Sébastien Eustace

Fix handling of dependencies with extras

parent 629fd555
......@@ -145,4 +145,8 @@ def dependency_from_pep_508(name):
dep.platform = ' || '.join(ors)
# Extras
for extra in req.extras:
dep.extras.append(extra)
return dep
......@@ -120,3 +120,14 @@ def test_dependency_platform_in():
assert dep.name == 'requests'
assert str(dep.constraint) == '== 2.18.0.0'
assert dep.platform == 'win32 || darwin'
def test_dependency_with_extra():
name = 'requests[security] (==2.18.0)'
dep = dependency_from_pep_508(name)
assert dep.name == 'requests'
assert str(dep.constraint) == '== 2.18.0.0'
assert len(dep.extras) == 1
assert dep.extras[0] == 'security'
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