Commit 9d1a81e0 by Sébastien Eustace

Fix handling of in environment markers with commas

parent 0e0a2612
# Change Log
## [Unreleased]
### Fixed
- Fixed handling of `in` environment markers with commas.
## [0.10.1] - 2018-05-28
### Fixed
......
......@@ -111,7 +111,7 @@ def dependency_from_pep_508(name):
version += '.*'
elif op == 'in':
versions = []
for v in version.split(' '):
for v in re.split('[ ,]+', version):
split = v.split('.')
if len(split) in [1, 2]:
split.append('*')
......@@ -141,7 +141,7 @@ def dependency_from_pep_508(name):
op = ''
elif op == 'in':
platforms = []
for v in platform.split(' '):
for v in re.split('[ ,]+', platform):
platforms.append(v)
if platforms:
......
......@@ -110,6 +110,18 @@ def test_dependency_python_version_in():
assert dep.python_versions == '3.3.* || 3.4.* || 3.5.*'
def test_dependency_python_version_in_comma():
name = (
'requests (==2.18.0); '
'python_version in \'3.3, 3.4, 3.5\''
)
dep = dependency_from_pep_508(name)
assert dep.name == 'requests'
assert str(dep.constraint) == '2.18.0'
assert dep.python_versions == '3.3.* || 3.4.* || 3.5.*'
def test_dependency_platform_in():
name = (
'requests (==2.18.0); '
......
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