From d49c35de78661b19ced7c428ded1a5e33403bc12 Mon Sep 17 00:00:00 2001 From: gzagatti Date: Thu, 2 Aug 2018 11:59:42 -0400 Subject: [PATCH 1/6] Improves message when dependencies could not be resolved. --- pipenv/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index 1f0f4ef4..f16d9a16 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -310,11 +310,13 @@ def actually_resolve_deps( click_echo( "{0}: Your dependencies could not be resolved. You likely have a " "mismatch in your sub-dependencies.\n " - "You can use {1} to bypass this mechanism, then run {2} to inspect " - "the situation.\n " - "Hint: try {3} if it is a pre-release dependency." + "First try clearing your dependency cache with {1} and trying again.\n " + "Alternatively, you can use {2} to bypass this mechanism, then run " + "{3} to inspect the situation.\n " + "Hint: try {4} if it is a pre-release dependency." "".format( crayons.red("Warning", bold=True), + crayons.red("$ pipenv lock --clear"), crayons.red("$ pipenv install --skip-lock"), crayons.red("$ pipenv graph"), crayons.red("$ pipenv lock --pre"), From 9070a6b92d7bc1fdcae8d7ac02d369a2ffacfec1 Mon Sep 17 00:00:00 2001 From: Jeremy Spencer Date: Fri, 3 Aug 2018 11:14:58 -0400 Subject: [PATCH 2/6] Added an example to README.md for installing from git --- README.md | 9 +++++++++ news/2685.doc | 1 + 2 files changed, 10 insertions(+) create mode 100644 news/2685.doc diff --git a/README.md b/README.md index 9c2f00b3..b552925a 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,15 @@ Install packages: To activate this project's virtualenv, run the following: $ pipenv shell +Install from git: + + $ pipenv install -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests + Installing -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests… + ... + Adding -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests to Pipfile's [packages]... + +You can also change the tag/ref (or exclude to get the latest version) by adding @version-or-tag before #egg=project_name + Install a dev dependency: $ pipenv install pytest --dev diff --git a/news/2685.doc b/news/2685.doc new file mode 100644 index 00000000..6f2a0aff --- /dev/null +++ b/news/2685.doc @@ -0,0 +1 @@ +Added simple example to README.md for installing from git. From 484340b8294fdb9a8a5a39f01832b463281572e7 Mon Sep 17 00:00:00 2001 From: gzagatti Date: Fri, 3 Aug 2018 12:08:57 -0400 Subject: [PATCH 3/6] Fixes grammar. --- pipenv/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index f16d9a16..2187ea68 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -310,7 +310,7 @@ def actually_resolve_deps( click_echo( "{0}: Your dependencies could not be resolved. You likely have a " "mismatch in your sub-dependencies.\n " - "First try clearing your dependency cache with {1} and trying again.\n " + "First try clearing your dependency cache with {1}, then try the original command again.\n " "Alternatively, you can use {2} to bypass this mechanism, then run " "{3} to inspect the situation.\n " "Hint: try {4} if it is a pre-release dependency." From a3162945be79182d0a4b4a7c140970dc340788fb Mon Sep 17 00:00:00 2001 From: Jeremy Spencer Date: Sun, 12 Aug 2018 16:15:17 -0400 Subject: [PATCH 4/6] mend --- README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b552925a..b6ef6e56 100644 --- a/README.md +++ b/README.md @@ -216,14 +216,30 @@ Install packages: To activate this project's virtualenv, run the following: $ pipenv shell -Install from git: +Installing from git: - $ pipenv install -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests - Installing -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests… - ... +You can install packages with pipenv from git and other version control systems using URLs formatted according to the following rule: + +``` + +:////@# +``` + +The only optional section is the `@` section. When using git over SSH, you may use the shorthand vcs and scheme alias `git+git@:/@#`. Note that this is translated to `git+ssh://git@` when parsed. + +Valid values for `` include `git`, `bzr`, `svn`, and `hg`. Valid values for `` include `http,`, `https`, `ssh`, and `file`. In specific cases you also have access to other schemes: `svn` may be combined with `svn` as a scheme, and `bzr` can be combined with `sftp` and `lp`. + +Note that it is **strongly recommended** that you install any version-controlled dependencies in editable mode in order to ensure that dependency resolution can be performed with an up to date copy of the repository each time it is performed, and that it includes all known dependencies. + +Below is an example usage which installs the git repository located at `https://github.com/requests/requests.git` from tag `v2.19.1` as package name `requests`: + +```console + $ pipenv install -e git+https://github.com/requests/requests.git@v2.19#egg=requests + Creating a Pipfile for this project... + Installing -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests... + [...snipped...] Adding -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests to Pipfile's [packages]... - -You can also change the tag/ref (or exclude to get the latest version) by adding @version-or-tag before #egg=project_name + [...] +``` Install a dev dependency: From 1188a3de34159b54cb747b346b5770e36e44e6d5 Mon Sep 17 00:00:00 2001 From: Jeremy Spencer Date: Mon, 13 Aug 2018 08:51:39 -0400 Subject: [PATCH 5/6] Updated for PR #2702. Added in request from user @uranusjr for pip documentation on vcs support and @slhck request for more consistent formatting of code blocks and more explict instructions for editable mode when installing from vcs --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b6ef6e56..16b72034 100644 --- a/README.md +++ b/README.md @@ -220,26 +220,24 @@ Installing from git: You can install packages with pipenv from git and other version control systems using URLs formatted according to the following rule: -``` +:////@# -``` The only optional section is the `@` section. When using git over SSH, you may use the shorthand vcs and scheme alias `git+git@:/@#`. Note that this is translated to `git+ssh://git@` when parsed. Valid values for `` include `git`, `bzr`, `svn`, and `hg`. Valid values for `` include `http,`, `https`, `ssh`, and `file`. In specific cases you also have access to other schemes: `svn` may be combined with `svn` as a scheme, and `bzr` can be combined with `sftp` and `lp`. -Note that it is **strongly recommended** that you install any version-controlled dependencies in editable mode in order to ensure that dependency resolution can be performed with an up to date copy of the repository each time it is performed, and that it includes all known dependencies. +Note that it is **strongly recommended** that you install any version-controlled dependencies in editable mode, using `pipenv install -e`, in order to ensure that dependency resolution can be performed with an up to date copy of the repository each time it is performed, and that it includes all known dependencies. Below is an example usage which installs the git repository located at `https://github.com/requests/requests.git` from tag `v2.19.1` as package name `requests`: -```console $ pipenv install -e git+https://github.com/requests/requests.git@v2.19#egg=requests Creating a Pipfile for this project... Installing -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests... [...snipped...] Adding -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests to Pipfile's [packages]... [...] -``` + +You can read more about [pip's implementation of vcs support here](https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support). Install a dev dependency: From a4ad13e52b8f0e4499196d1e8bc17fcd8be9b868 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Fri, 17 Aug 2018 16:34:28 -0400 Subject: [PATCH 6/6] Update readme images, port readme add news Signed-off-by: Dan Ryan --- README.md | 6 +++--- docs/basics.rst | 23 ++++++++++++++++++----- news/2696.trivial | 1 + 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 news/2696.trivial diff --git a/README.md b/README.md index 16b72034..5a5d4ca5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ Pipenv: Python Development Workflow for Humans ============================================== -[![image](https://img.shields.io/pypi/v/pipenv.svg)](https://pypi.python.org/pypi/pipenv) -[![image](https://img.shields.io/pypi/l/pipenv.svg)](https://pypi.python.org/pypi/pipenv) +[![image](https://img.shields.io/pypi/v/pipenv.svg)](https://python.org/pypi/pipenv) +[![image](https://img.shields.io/pypi/l/pipenv.svg)](https://python.org/pypi/pipenv) [![image](https://badge.buildkite.com/79c7eccf056b17c3151f3c4d0e4c4b8b724539d84f1e037b9b.svg?branch=master)](https://code.kennethreitz.org/source/pipenv/) -[![image](https://img.shields.io/pypi/pyversions/pipenv.svg)](https://pypi.python.org/pypi/pipenv) +[![image](https://img.shields.io/pypi/pyversions/pipenv.svg)](https://python.org/pypi/pipenv) [![image](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/kennethreitz) ------------------------------------------------------------------------ diff --git a/docs/basics.rst b/docs/basics.rst index a38d3403..e6afea3f 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -334,17 +334,30 @@ If you experience issues with ``$ pipenv shell``, just check the ``PIPENV_SHELL` ☤ A Note about VCS Dependencies ------------------------------- -Pipenv will resolve the sub–dependencies of VCS dependencies, but only if they are installed in editable mode:: +You can install packages with pipenv from git and other version control systems using URLs formatted according to the following rule:: - $ pipenv install -e git+https://github.com/requests/requests.git#egg=requests + +:////@# + +The only optional section is the ``@`` section. When using git over SSH, you may use the shorthand vcs and scheme alias ``git+git@:/@#``. Note that this is translated to ``git+ssh://git@`` when parsed. + +Note that it is **strongly recommended** that you install any version-controlled dependencies in editable mode, using ``pipenv install -e``, in order to ensure that dependency resolution can be performed with an up to date copy of the repository each time it is performed, and that it includes all known dependencies. + +Below is an example usage which installs the git repository located at ``https://github.com/requests/requests.git`` from tag ``v2.19.1`` as package name ``requests``:: + + $ pipenv install -e git+https://github.com/requests/requests.git@v2.19#egg=requests + Creating a Pipfile for this project... + Installing -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests... + [...snipped...] + Adding -e git+https://github.com/requests/requests.git@v2.19.1#egg=requests to Pipfile's [packages]... + [...] $ cat Pipfile [packages] - requests = {git = "https://github.com/requests/requests.git", editable=true} + requests = {git = "https://github.com/requests/requests.git", editable = true, ref = "2.19.1"} -If editable is not true, sub–dependencies will not be resolved. +Valid values for ```` include ``git``, ``bzr``, ``svn``, and ``hg``. Valid values for ```` include ``http``, ``https``, ``ssh``, and ``file``. In specific cases you also have access to other schemes: ``svn`` may be combined with ``svn`` as a scheme, and ``bzr`` can be combined with ``sftp`` and ``lp``. -For more information about other options available when specifying VCS dependencies, please check the `Pipfile spec `__. +You can read more about pip's implementation of VCS support `here `_. For more information about other options available when specifying VCS dependencies, please check the `Pipfile spec `_. ☤ Pipfile.lock Security Features diff --git a/news/2696.trivial b/news/2696.trivial new file mode 100644 index 00000000..dc68eca0 --- /dev/null +++ b/news/2696.trivial @@ -0,0 +1 @@ +Added additional information to error messaging during failed resolution.