Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed May 28, 2018
1 parent 824f822 commit a5e69e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pipenv/patched/piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ def get_legacy_dependencies(self, ireq):
setup_requires = self.finder.get_extras_links(
dist.get_metadata_lines('requires.txt')
)
# HACK: Sometimes the InstallRequirement doesn't properly get
# these values set on it during the resolution process. It's
# difficult to pin down what is going wrong. This fixes things.
ireq.version = dist.version
ireq.project_name = dist.project_name
ireq.req = dist.as_requirement()
Expand Down
5 changes: 5 additions & 0 deletions pipenv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,13 @@ class PipCommand(basecommand.Command):
if ' -i ' in dep:
dep, url = dep.split(' -i ')
req = Requirement.from_line(dep)

# req.as_line() is theoratically the same as dep, but is guarenteed to
# be normalized. This is safer than passing in dep.
# TODO: Stop passing dep lines around; just use requirement objects.
constraints.append(req.as_line())
# extra_constraints = []

if url:
index_lookup[req.name] = project.get_source(url=url).get('name')
if req.markers:
Expand Down
5 changes: 4 additions & 1 deletion tasks/vendoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,10 @@ def generate_patch(ctx, package_path, patch_description, base='HEAD'):
pkg = Path(package_path)
if len(pkg.parts) != 2 or pkg.parts[0] not in ('vendor', 'patched'):
raise ValueError('example usage: generate-patch patched/pew some-description')
patch_fn = '{0}-{1}.patch'.format(pkg.parts[1], patch_description)
if patch_description:
patch_fn = '{0}-{1}.patch'.format(pkg.parts[1], patch_description)
else:
patch_fn = '{0}.patch'.format(pkg.parts[1])
command = 'git diff {base} -p {root} > {out}'.format(
base=base,
root=Path('pipenv').joinpath(pkg),
Expand Down

0 comments on commit a5e69e4

Please sign in to comment.