Skip to content

Commit

Permalink
Refactor existing pins evaluation
Browse files Browse the repository at this point in the history
This was failing on second run because of unamed editable req.
Use dictionary comprehension as key evaluation was not used outside
loop.

Fixes jazzband#477
  • Loading branch information
davidovich committed Mar 30, 2017
1 parent 6853353 commit 26bde33
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions piptools/scripts/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,8 @@ def cli(verbose, dry_run, pre, rebuild, find_links, index_url, extra_index_url,
# Proxy with a LocalRequirementsRepository if --upgrade is not specified
# (= default invocation)
if not (upgrade or upgrade_packages) and os.path.exists(dst_file):
existing_pins = {}
ireqs = parse_requirements(dst_file, finder=repository.finder, session=repository.session, options=pip_options)
for ireq in ireqs:
key = key_from_req(ireq.req)

if is_pinned_requirement(ireq):
existing_pins[key] = ireq
existing_pins = {key_from_req(ireq.req): ireq for ireq in ireqs if is_pinned_requirement(ireq)}
repository = LocalRequirementsRepository(existing_pins, repository)

log.debug('Using indexes:')
Expand Down

0 comments on commit 26bde33

Please sign in to comment.