Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix direct url dependency resolution #3298

Merged
merged 74 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ffb46e4
Fix direct url dependency resolution
techalchemy Nov 25, 2018
2798733
Merge branch 'master' into bugfix/3148
techalchemy Nov 25, 2018
bd78dae
WIP continued, some fixes
techalchemy Nov 25, 2018
ed3f206
Update vendored dependency pins
techalchemy Jan 21, 2019
574fe73
Update all vendored dependencies
techalchemy Jan 22, 2019
ea1096d
Update pythonfinder
techalchemy Jan 22, 2019
4a8eead
Remove pyc from pyinstaller and grab final updates from pythonfinder
techalchemy Jan 22, 2019
1601511
Don't depend on kenneth's personal mirror for testing
techalchemy Jan 22, 2019
7ad588d
A few fixes for windows and relative paths
techalchemy Jan 22, 2019
7b25a5c
fix pythonfinder
techalchemy Jan 22, 2019
3289c7b
Update pythonfinder windows implementation
techalchemy Jan 22, 2019
39c3b3a
Fix editable and local setup.py builds
techalchemy Jan 23, 2019
86ca6ff
Fix direct url dependency resolution
techalchemy Nov 25, 2018
da14a88
WIP continued, some fixes
techalchemy Nov 25, 2018
846b67f
Update PEP 508 dependency parsing implementation
techalchemy Jan 24, 2019
23ee483
Add pep517 to environment path
techalchemy Jan 24, 2019
eae3958
Fix pep508 direct URL depedencies
techalchemy Jan 27, 2019
19f2ee6
Update resolver to handle all resolution in venv
Feb 11, 2019
01845e5
Update requirementslib for PEP517 builder
techalchemy Feb 15, 2019
41345a7
requirementslib bugfixes
techalchemy Feb 15, 2019
f5fda09
Direct URL updates and pep517 fixes
techalchemy Feb 15, 2019
ef682bd
Fix tuple bug in resolver
techalchemy Feb 15, 2019
c049976
Pass all packages through to `venv_resolve_deps`
techalchemy Feb 16, 2019
6b1d617
Add pytoml (dependency of pep517)
techalchemy Feb 16, 2019
e392b02
Add additional test packages
techalchemy Feb 17, 2019
222eb50
Fix buggy pep517 implementation
techalchemy Feb 17, 2019
53c4968
Fix name reference
techalchemy Feb 17, 2019
eaf7504
Fix specifier parsing in python 2
techalchemy Feb 17, 2019
a019de0
Restore existing pyinstaller commit
techalchemy Feb 17, 2019
f6e657e
Update lockfile
techalchemy Feb 18, 2019
08a8bbc
Add test extras to setup.py to pin pytest
techalchemy Feb 18, 2019
f8a5102
Install local tests extra for test runners
techalchemy Feb 18, 2019
9a47590
Fix pipenv clean to stop trying to remove python
techalchemy Feb 18, 2019
907aca1
Use set comparisons for removing packages
techalchemy Feb 19, 2019
caf4818
Update azure test runner
techalchemy Feb 19, 2019
c54aa54
Fix uninstall and error formatting
techalchemy Feb 19, 2019
a522430
Update test runner scripts to handle both python versions
techalchemy Feb 19, 2019
5ac228e
Fix test errors and local install for azure
techalchemy Feb 19, 2019
bfdb9ae
Fix installed package discovery
techalchemy Feb 20, 2019
9340ddb
Update tests to rectify issues
techalchemy Feb 20, 2019
a47a26b
Fix failing tests
techalchemy Feb 20, 2019
8041704
Merge branch 'bugfix/3148' of github.com:pypa/pipenv into bugfix/3148
techalchemy Feb 20, 2019
16a249f
Fix installed package discovery on windows
techalchemy Feb 20, 2019
cd2cbd4
Avoid using `which` in cross platform tests
techalchemy Feb 20, 2019
3bc48f0
Fix venv with leading dash test on windows and clean up tests
techalchemy Feb 22, 2019
7f75507
Clean up path checks in environment
techalchemy Feb 22, 2019
3f3e61e
Fix path reformatting for posix python path
techalchemy Feb 22, 2019
565850d
Fix broken imports
techalchemy Feb 22, 2019
018e6fe
Fix pipenv dist discovery
techalchemy Feb 23, 2019
33e456d
Merge branch 'bugfix/3148' of github.com:pypa/pipenv into bugfix/3148
techalchemy Feb 23, 2019
090619a
Fix virtualenv tempdir lifespan
techalchemy Feb 23, 2019
b0ba9a8
Update syntax for context manager virtualenv test class
techalchemy Feb 23, 2019
05d3b5a
Update license download script
techalchemy Feb 25, 2019
bc3d50b
Update vendored vistir
techalchemy Feb 26, 2019
32876ec
Update requirementslib
techalchemy Feb 26, 2019
3f053a3
Fix command dispatching
Feb 27, 2019
4848a1e
Update vistir and requirementslib
techalchemy Mar 1, 2019
199a14a
Incorporate fixes from feature/keep-outdated-peep
techalchemy Mar 2, 2019
be3c771
Cut in new cursor implementation
techalchemy Mar 2, 2019
57b266f
Update requirementslib to include extras in parser
techalchemy Mar 2, 2019
e238c84
Only resolve requirements with markers we can evaluate
techalchemy Mar 3, 2019
de4d659
requirementslib bugfix
techalchemy Mar 3, 2019
374086e
Update requirementslib
techalchemy Mar 4, 2019
7fe11e7
Add new file for requirementslib
techalchemy Mar 4, 2019
a1cb576
vendor orderedmultidict
techalchemy Mar 4, 2019
cebe0ac
Update vnedored dependency list
techalchemy Mar 4, 2019
37916cb
Re-add passa
techalchemy Mar 4, 2019
716dfb4
Update vistir patch
techalchemy Mar 4, 2019
2d1b4bd
Update setup dependencies
techalchemy Mar 4, 2019
dc41e66
Re-run vendoring script
techalchemy Mar 4, 2019
c53e29b
Fix vendoring script in azure pipeline
techalchemy Mar 5, 2019
01444da
Update news files
techalchemy Mar 5, 2019
439a258
One more news file update
techalchemy Mar 5, 2019
b395aca
Add missing news entries
techalchemy Mar 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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