Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored Mar 8, 2019
2 parents 4514c0c + 6b8745d commit 546e3ac
Show file tree
Hide file tree
Showing 215 changed files with 14,859 additions and 5,011 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.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ well as adds/removes packages from your `Pipfile` as you
install/uninstall packages. It also generates the ever-important
`Pipfile.lock`, which is used to produce deterministic builds.

![image](http://media.kennethreitz.com.s3.amazonaws.com/pipenv.gif)
![image](https://s3.amazonaws.com/media.kennethreitz.com/pipenv.gif)

The problems that Pipenv seeks to solve are multi-faceted:

Expand Down
2 changes: 1 addition & 1 deletion docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ To make inclusive or exclusive version comparisons you can use: ::
to avoid issues with `Input and output redirection <https://robots.thoughtbot.com/input-output-redirection-in-the-shell>`_
in Unix-based operating systems.

The use of ``~=`` is preferred over the ``==`` identifier as the former prevents pipenv from updating the packages: ::
The use of ``~=`` is preferred over the ``==`` identifier as the latter prevents pipenv from updating the packages: ::

$ pipenv install "requests~=2.2" # locks the major version of the package (this is equivalent to using ==2.*)

Expand Down
13 changes: 6 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ It automatically creates and manages a virtualenv for your projects, as well as

Pipenv is primarily meant to provide users and developers of applications with an easy method to setup a working environment. For the distinction between libraries and applications and the usage of ``setup.py`` vs ``Pipfile`` to define dependencies, see :ref:`pipfile-vs-setuppy`.

.. raw:: html

<iframe src="https://player.vimeo.com/video/233134524" width="700" height="460" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

.. image:: https://s3.amazonaws.com/media.kennethreitz.com/pipenv.gif
:height: 341px
:width: 654px
:scale: 100 %
:alt: a short animation of pipenv at work

The problems that Pipenv seeks to solve are multi-faceted:

- You no longer need to use ``pip`` and ``virtualenv`` separately. They work together.
Expand Down Expand Up @@ -70,9 +72,6 @@ Otherwise, refer to the :ref:`installing-pipenv` chapter for instructions.
User Testimonials
-----------------

**Jannis Leidel**, former pip maintainer—
*Pipenv is the porcelain I always wanted to build for pip. It fits my brain and mostly replaces virtualenvwrapper and manual pip calls for me. Use it.*

**David Gang**—
*This package manager is really awesome. For the first time I know exactly what my dependencies are which I installed and what the transitive dependencies are. Combined with the fact that installs are deterministic, makes this package manager first class, like cargo*.

Expand Down
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.
1 change: 1 addition & 0 deletions news/3292.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update pytest-pypi documentation not to be pytest-httpbin documentation.
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.
1 change: 1 addition & 0 deletions news/3499.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace (non-existant) video on docs index.rst with equivalent gif.
1 change: 1 addition & 0 deletions news/3502.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug causing ``[SSL: CERTIFICATE_VERIFY_FAILED]`` when Pipfile ``[[source]]`` has verify_ssl=false and url with custom port.
1 change: 1 addition & 0 deletions news/3584.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the issue that lock file can't be created when ``PIPENV_PIPFILE`` is not under working directory.
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()
8 changes: 5 additions & 3 deletions 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 Expand Up @@ -293,8 +294,9 @@ def callback(ctx, param, value):
if value:
state.installstate.code = value
return value
return option("--code", "-c", nargs=1, default=False, help="Import from codebase.",
callback=callback, expose_value=False)(f)
return option("--code", "-c", nargs=1, default=False, help="Install packages "
"automatically discovered from import statements.", callback=callback,
expose_value=False)(f)


def deploy_option(f):
Expand Down
Loading

0 comments on commit 546e3ac

Please sign in to comment.