Skip to content

Commit

Permalink
Merge pull request #3298 from pypa/bugfix/3148
Browse files Browse the repository at this point in the history
Fix direct url dependency resolution
  • Loading branch information
techalchemy authored Mar 5, 2019
2 parents 44db5dd + b395aca commit 54a73d1
Show file tree
Hide file tree
Showing 205 changed files with 14,804 additions and 4,775 deletions.
3 changes: 2 additions & 1 deletion .azure-pipelines/jobs/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ steps:
export PIP_PROCESS_DEPENDENCY_LINKS="1"
echo "Path $PATH"
echo "Installing Pipenv…"
pip install -e "$(pwd)" --upgrade
pip install -e "$(pwd)[test]" --upgrade
pipenv install --deploy --dev
pipenv run pip install -e "$(pwd)[test]" --upgrade
echo pipenv --venv && echo pipenv --py && echo pipenv run python --version
displayName: Make Virtualenv

Expand Down
5 changes: 2 additions & 3 deletions .azure-pipelines/jobs/run-vendor-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ jobs:
maxParallel: 4
matrix:
${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
# TODO remove once vs2017-win2016 has Python 3.7
Python37:
python.version: '>= 3.7.0-b2'
python.version: '>= 3.7.2'
python.architecture: x64
${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}:
Python37:
Expand All @@ -33,7 +32,7 @@ jobs:
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install --upgrade invoke requests parver bs4 vistir towncrier
python -m pip install --upgrade invoke requests parver bs4 vistir towncrier pip setuptools wheel --upgrade-strategy=eager
python -m invoke vendoring.update
- template: ./run-manifest-check.yml
2 changes: 1 addition & 1 deletion .azure-pipelines/steps/create-virtualenv.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- script: |
virtualenv D:\.venv
D:\.venv\Scripts\pip.exe install -e . && D:\.venv\Scripts\pipenv install --dev
D:\.venv\Scripts\pip.exe install -e .[test] && D:\.venv\Scripts\pipenv install --dev && D:\.venv\Scripts\pipenv run pip install -e .[test]
echo D:\.venv\Scripts\pipenv --venv && echo D:\.venv\Scripts\pipenv --py && echo D:\.venv\Scripts\pipenv run python --version
displayName: Make Virtualenv
2 changes: 1 addition & 1 deletion .azure-pipelines/steps/install-dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
steps:
- script: 'python -m pip install --upgrade pip && python -m pip install -e .'
- script: 'python -m pip install --upgrade pip && python -m pip install -e .[test]'
displayName: Upgrade Pip & Install Pipenv
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,8 @@ venv.bak/

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
.vs/slnx.sqlite

# mypy/typing section
typeshed/
.dmypy.json
mypyhtml/
9 changes: 2 additions & 7 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
[dev-packages]
pipenv = {path = ".", editable = true}
pipenv = {path = ".", editable = true, extras = ["test"]}
"flake8" = ">=3.3.0,<4"
pytest = "*"
mock = "*"
sphinx = "<=1.5.5"
twine = "*"
sphinx-click = "*"
pytest-xdist = "*"
click = "*"
pytest-pypy = {path = "./tests/pytest-pypi", editable = true}
pytest-tap = "*"
flaky = "*"
pytest-pypi = {path = "./tests/pytest-pypi", editable = true}
stdeb = {version="*", markers="sys_platform == 'linux'"}
black = {version="*", markers="python_version >= '3.6'"}
pytz = "*"
Expand Down
437 changes: 208 additions & 229 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions news/2722.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug which caused editable package resolution to sometimes fail with an unhelpful setuptools-related error message.
1 change: 1 addition & 0 deletions news/3053.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dependency resolution now writes hashes for local and remote files to the lockfile.
1 change: 1 addition & 0 deletions news/3071.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug which prevented ``pipenv graph`` from correctly showing all dependencies when running from within ``pipenv shell``.
1 change: 1 addition & 0 deletions news/3148.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed resolution of direct-url dependencies in ``setup.py`` files to respect ``PEP-508`` style URL dependencies.
1 change: 1 addition & 0 deletions news/3148.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for resolution of direct-url dependencies in ``setup.py`` files to respect ``PEP-508`` style URL dependencies.
3 changes: 3 additions & 0 deletions news/3298.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed a bug which caused failures in warning reporting when running pipenv inside a virtualenv under some circumstances.

- Fixed a bug with package discovery when running ``pipenv clean``.
5 changes: 5 additions & 0 deletions news/3298.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Added full support for resolution of all dependency types including direct URLs, zip archives, tarballs, etc.

- Improved error handling and formatting.

- Introduced improved cross platform stream wrappers for better ``stdout`` and ``stderr`` consistency.
28 changes: 28 additions & 0 deletions news/3298.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Updated vendored dependencies:

- **attrs**: ``18.2.0`` => ``19.1.0``
- **certifi**: ``2018.10.15`` => ``2018.11.29``
- **cached_property**: ``1.4.3`` => ``1.5.1``
- **colorama**: ``0.3.9`` => ``0.4.1``
- **idna**: ``2.7`` => ``2.8``
- **markupsafe**: ``1.0`` => ``1.1.1``
- **orderedmultidict**: ``(new)`` => ``1.0``
- **packaging**: ``18.0`` => ``19.0``
- **parse**: ``1.9.0`` => ``1.11.1``
- **pathlib2**: ``2.3.2`` => ``2.3.3``
- **pep517**: ``(new)`` => ``0.5.0``
- **pipdeptree**: ``0.13.0`` => ``0.13.2``
- **pyparsing**: ``2.2.2`` => ``2.3.1``
- **python-dotenv**: ``0.9.1`` => ``0.10.1``
- **pythonfinder**: ``1.1.10`` => ``1.2.0``
- **pytoml**: ``(new)`` => ``0.1.20``
- **requests**: ``2.20.1`` => ``2.21.0``
- **requirementslib**: ``1.3.3`` => ``1.4.2``
- **shellingham**: ``1.2.7`` => ``1.2.8``
- **six**: ``1.11.0`` => ``1.12.0``
- **tomlkit**: ``0.5.2`` => ``0.5.3``
- **urllib3**: ``1.24`` => ``1.24.1``
- **vistir**: ``0.3.0`` => ``0.3.1``
- **yaspin**: ``0.14.0`` => ``0.14.1``

- Removed vendored dependency **cursor**.
1 change: 1 addition & 0 deletions news/3328.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pipenv will now successfully recursively lock VCS sub-dependencies.
1 change: 1 addition & 0 deletions news/3368.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pipenv will now discover and resolve the intrinsic dependencies of **all** VCS dependencies, whether they are editable or not, to prevent resolution conflicts.
1 change: 1 addition & 0 deletions news/3404.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a keyerror which could occur when locking VCS dependencies in some cases.
2 changes: 1 addition & 1 deletion news/3427.bugfix.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix a bug that ``ValidationError`` is thrown when some fields are missing in source section.
Fixed a bug that ``ValidationError`` is thrown when some fields are missing in source section.
2 changes: 1 addition & 1 deletion news/3446.trivial.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix the wrong order of old and new hashes in message.
Fixed the wrong order of old and new hashes in message.
2 changes: 1 addition & 1 deletion news/3449.bugfix.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Update the index names in lock file when source name in Pipfile is changed.
Updated the index names in lock file when source name in Pipfile is changed.
9 changes: 6 additions & 3 deletions pipenv/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
operating systems, etc.
"""

import functools
import importlib
import io
import os
import sys
import warnings
Expand Down Expand Up @@ -122,6 +119,12 @@ def force_encoding():
}


def decode_for_output(output, target=sys.stdout):
return vistir.misc.decode_for_output(
output, sys.stdout, translation_map=UNICODE_TO_ASCII_TRANSLATION_MAP
)


def decode_output(output):
if not isinstance(output, six.string_types):
return output
Expand Down
10 changes: 3 additions & 7 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import crayons
import delegator

from click_didyoumean import DYMCommandCollection

from ..__version__ import __version__
from .options import (
CONTEXT_SETTINGS, PipenvGroup, code_option, common_options, deploy_option,
Expand Down Expand Up @@ -300,6 +298,7 @@ def uninstall(
if retcode:
sys.exit(retcode)


@cli.command(short_help="Generates Pipfile.lock.", context_settings=CONTEXT_SETTINGS)
@lock_options
@pass_state
Expand Down Expand Up @@ -400,7 +399,6 @@ def shell(
def run(state, command, args):
"""Spawns a command installed into the virtualenv."""
from ..core import do_run

do_run(
command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
)
Expand Down Expand Up @@ -629,11 +627,9 @@ def sync(
def clean(ctx, state, dry_run=False, bare=False, user=False):
"""Uninstalls all packages not specified in Pipfile.lock."""
from ..core import do_clean
do_clean(ctx=ctx, three=state.three, python=state.python, dry_run=dry_run)
do_clean(ctx=ctx, three=state.three, python=state.python, dry_run=dry_run,
system=state.system)


# Only invoke the "did you mean" when an argument wasn't passed (it breaks those).
if "-" not in "".join(sys.argv) and len(sys.argv) > 1:
cli = DYMCommandCollection(sources=[cli])
if __name__ == "__main__":
cli()
3 changes: 2 additions & 1 deletion pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from click import (
BadParameter, Group, Option, argument, echo, make_pass_decorator, option
)
from click_didyoumean import DYMMixin

from .. import environments
from ..utils import is_valid_url
Expand All @@ -19,7 +20,7 @@
}


class PipenvGroup(Group):
class PipenvGroup(DYMMixin, Group):
"""Custom Group class provides formatted main help"""

def get_help_option(self, ctx):
Expand Down
Loading

0 comments on commit 54a73d1

Please sign in to comment.