From 39e00464b75db8ff6d7dcefad00defb8e11783f0 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Wed, 24 Jan 2018 01:04:32 -0500 Subject: [PATCH] Swap from ansible to alembic for win compatibility - Ansible is not compatible with windows so we shouldn't use it for testing, it is causing failures - Test for string presence before assuming str cmp - Fixes #1329 - Potentially resolves other issues with passing requirements markers from the command line --- pipenv/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index 83a38027..e7323824 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -508,6 +508,9 @@ def convert_deps_to_pip(deps, project=None, r=True, include_index=False): dependencies = [] + def is_star(val): + return isinstance(val, six.string_types) and val == '*' + for dep in deps.keys(): # Default (e.g. '>1.10'). @@ -516,7 +519,7 @@ def convert_deps_to_pip(deps, project=None, r=True, include_index=False): index = '' # Get rid of '*'. - if deps[dep] == '*' or str(extra) == '{}': + if is_star(deps[dep]) or str(extra) == '{}': extra = '' hash = '' @@ -533,7 +536,7 @@ def convert_deps_to_pip(deps, project=None, r=True, include_index=False): extra = '[{0}]'.format(deps[dep]['extras'][0]) if 'version' in deps[dep]: - if not deps[dep]['version'] == '*': + if not is_star(deps[dep]['version']): version = deps[dep]['version'] # For lockfile format. @@ -544,7 +547,7 @@ def convert_deps_to_pip(deps, project=None, r=True, include_index=False): specs = [] for specifier in specifiers: if specifier in deps[dep]: - if not deps[dep][specifier] == '*': + if not is_star(deps[dep][specifier]): specs.append('{0} {1}'.format(specifier, deps[dep][specifier])) if specs: specs = '; {0}'.format(' and '.join(specs))