mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge branch 'master' into bugfix/windows-bugs
This commit is contained in:
+3
-3
@@ -625,9 +625,9 @@ def ensure_project(three=None, python=None, validate=True, system=False, warn=Tr
|
||||
# Warn users if they are using the wrong version of Python.
|
||||
if project.required_python_version:
|
||||
|
||||
path_to_python = which('python')
|
||||
path_to_python = which('python') or which('py')
|
||||
|
||||
if project.required_python_version not in (python_version(path_to_python) or ''):
|
||||
if path_to_python and project.required_python_version not in (python_version(path_to_python) or ''):
|
||||
click.echo(
|
||||
'{0}: Your Pipfile requires {1} {2}, '
|
||||
'but you are using {3} ({4}).'.format(
|
||||
@@ -1767,7 +1767,7 @@ def do_install(
|
||||
except IOError:
|
||||
click.echo(
|
||||
crayons.red(
|
||||
u'Unable to find requirements file at {0}.'.format(crayons.normal(requirements))
|
||||
u'Unable to find requirements file at {0}.'.format(crayons.normal(requirements))
|
||||
),
|
||||
err=True
|
||||
)
|
||||
|
||||
@@ -307,6 +307,21 @@ class Resolver(object):
|
||||
', '.join(sorted(dependency_strings, key=lambda s: s.lower())) or '-'))
|
||||
from pip._vendor.packaging.markers import InvalidMarker
|
||||
for dependency_string in dependency_strings:
|
||||
individual_dependencies = [dep.strip() for dep in dependency_string.split(', ')]
|
||||
cleaned_deps = []
|
||||
for dep in individual_dependencies:
|
||||
tokens = [token.strip() for token in dep.split(';')]
|
||||
cleaned_tokens = []
|
||||
markers = []
|
||||
if len(tokens) == 1:
|
||||
cleaned_deps.append(tokens[0])
|
||||
continue
|
||||
markers = list(set(tokens[1:]))
|
||||
cleaned_tokens.append(tokens[0])
|
||||
if markers:
|
||||
cleaned_tokens.extend(markers)
|
||||
cleaned_deps.append('; '.join(cleaned_tokens))
|
||||
dependency_string = ', '.join(set(cleaned_deps))
|
||||
yield InstallRequirement.from_line(dependency_string, constraint=ireq.constraint)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user