diff --git a/pipenv/patched/piptools/repositories/pypi.py b/pipenv/patched/piptools/repositories/pypi.py index e73cb2d030..c435be0753 100644 --- a/pipenv/patched/piptools/repositories/pypi.py +++ b/pipenv/patched/piptools/repositories/pypi.py @@ -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() diff --git a/pipenv/utils.py b/pipenv/utils.py index a8664ddcdd..27ce9d301d 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -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: diff --git a/tasks/vendoring/__init__.py b/tasks/vendoring/__init__.py index 9bd14deea3..4b64b818b6 100644 --- a/tasks/vendoring/__init__.py +++ b/tasks/vendoring/__init__.py @@ -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),