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
This commit is contained in:
Dan Ryan
2018-01-24 01:04:32 -05:00
parent 43e8732bae
commit 39e00464b7
+6 -3
View File
@@ -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))