Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gsemet committed Mar 31, 2018
1 parent fb6e292 commit b2c777f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pipenv/patched/notpip/req/req_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def _check_skip_installed(self, req_to_install, finder):
elif self.upgrade_strategy == "only-if-needed":
skip_reason = 'not upgraded as not directly required'
else:
skip_reason = 'already satisfied'
skip_reason = 'already satisfied123'

return skip_reason
else:
Expand Down
11 changes: 11 additions & 0 deletions pipenv/patched/piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,22 @@ def find_best_match(self, ireq, prereleases=None):

all_candidates = self.find_all_candidates(ireq.name)
candidates_by_version = lookup_table(all_candidates, key=lambda c: c.version, unique=True)
import click
click.echo("\n====START\n", err=True)
click.echo("ireq={!r}".format(ireq), err=True)
click.echo("all_candidates={!r}".format(all_candidates), err=True)
click.echo("prereleases={!r}".format(prereleases), err=True)

matching_versions = ireq.specifier.filter((candidate.version for candidate in all_candidates),
prereleases=prereleases)

# Reuses pip's internal candidate sort key to sort

click.echo("candidates_by_version={!r}".format(candidates_by_version), err=True)
click.echo("matching_versions={!r}".format(matching_versions), err=True)
matching_candidates = [candidates_by_version[ver] for ver in matching_versions]
click.echo("matching_candidates={!r}\n".format(matching_candidates), err=True)
click.echo("\n====END\n", err=True)
if not matching_candidates:
raise NoCandidateFound(ireq, all_candidates)
best_candidate = max(matching_candidates, key=self.finder._candidate_sort_key)
Expand Down
1 change: 1 addition & 0 deletions pipenv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ def resolve_deps(
except RuntimeError:
sys.exit(1)
for result in resolved_tree:
print("resolve_deps 3", file=sys.stderr)
if not result.editable:
name = pep423_name(result.name)
version = clean_pkg_version(result.specifier)
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/pip9/req/req_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def _check_skip_installed(self, req_to_install, finder):
elif self.upgrade_strategy == "only-if-needed":
skip_reason = 'not upgraded as not directly required'
else:
skip_reason = 'already satisfied'
skip_reason = 'already satisfied456'

return skip_reason
else:
Expand Down
5 changes: 3 additions & 2 deletions tests/test_pipenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,12 +1317,13 @@ def test_install_pinned_pinned_preversion(self, pypi):
transitive_pkg_name = 'neo4j-driver'
transitive_pkg_pinned_version = '==1.1.0rc1'
transitive_pkg_version = '>=1.1.0rc1'
c = p.pipenv('install {0}{1}'.format(target_package, preversion))
c = p.pipenv('install --verbose {0}{1}'.format(target_package, preversion))
assert c.return_code == 0
c = p.pipenv('install {0}{1}'.format(transitive_pkg_name, transitive_pkg_version))
c = p.pipenv('install --verbose {0}{1}'.format(transitive_pkg_name, transitive_pkg_version))
assert c.return_code == 0
assert target_package in p.pipfile['packages']
assert p.pipfile['packages'][target_package] == preversion
assert target_package in p.lockfile['default']
assert transitive_pkg_name in p.lockfile['default']
assert p.lockfile['default'][transitive_pkg_name]['version'] == transitive_pkg_pinned_version
assert False

0 comments on commit b2c777f

Please sign in to comment.