From 7708cd8445e0bc18beb4cc09d21ec4a773b4b8d3 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Sat, 3 Aug 2019 10:43:24 +0800 Subject: [PATCH 01/46] Pass lock options to outdated --- news/3879.bugfix.rst | 1 + pipenv/cli/command.py | 2 +- pipenv/core.py | 5 ++--- tests/integration/test_cli.py | 13 +++++++++++++ tests/integration/test_install_basic.py | 11 ++++++++++- 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 news/3879.bugfix.rst diff --git a/news/3879.bugfix.rst b/news/3879.bugfix.rst new file mode 100644 index 00000000..95413ca5 --- /dev/null +++ b/news/3879.bugfix.rst @@ -0,0 +1 @@ +Pass ``--pre`` and ``--clear`` options to ``pipenv update --outdated``. diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index c2cd2e49..3fa6b611 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -484,7 +484,7 @@ def update( if not outdated: outdated = bool(dry_run) if outdated: - do_outdated(pypi_mirror=state.pypi_mirror) + do_outdated(clear=state.clear, pre=state.installstate.pre, pypi_mirror=state.pypi_mirror) packages = [p for p in state.installstate.packages if p] editable = [p for p in state.installstate.editables if p] if not packages: diff --git a/pipenv/core.py b/pipenv/core.py index 0637c225..67a45197 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1767,12 +1767,11 @@ def do_py(system=False): click.echo(crayons.red("No project found!")) -def do_outdated(pypi_mirror=None): +def do_outdated(pypi_mirror=None, pre=False, clear=False): # TODO: Allow --skip-lock here? from .vendor.requirementslib.models.requirements import Requirement from .vendor.requirementslib.models.utils import get_version from .vendor.packaging.utils import canonicalize_name - from .vendor.vistir.compat import Mapping from collections import namedtuple packages = {} @@ -1789,7 +1788,7 @@ def do_outdated(pypi_mirror=None): dep = Requirement.from_line(str(result.as_requirement())) packages.update(dep.as_pipfile()) updated_packages = {} - lockfile = do_lock(write=False, pypi_mirror=pypi_mirror) + lockfile = do_lock(clear=clear, pre=pre, write=False, pypi_mirror=pypi_mirror) for section in ("develop", "default"): for package in lockfile[section]: try: diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 1ee9f64a..4d930fc3 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -265,3 +265,16 @@ def test_pipenv_three(PipenvInstance): c = p.pipenv('--three') assert c.return_code == 0 assert 'Successfully created virtual environment' in c.err + + +@pytest.mark.outdated +def test_pipenv_outdated_prerelease(PipenvInstance): + with PipenvInstance(chdir=True) as p: + with open(p.pipfile_path, "w") as f: + contents = """ +[packages] +sqlalchemy = "==1.2.0b3" + """.strip() + f.write(contents) + c = p.pipenv('update --pre --outdated') + assert c.return_code == 0 diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 80ccdf0e..f42b8f3f 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -7,7 +7,6 @@ import pytest from flaky import flaky from pipenv._compat import Path, TemporaryDirectory -from pipenv.project import Project from pipenv.utils import temp_environ from pipenv.vendor import delegator @@ -475,3 +474,13 @@ extras = ["socks"] assert 'six = {version = "*"}' in contents assert 'requests = {version = "*"' in contents assert 'plette = "*"' in contents + + +@pytest.mark.install +def test_install_prerelease(PipenvInstance): + with PipenvInstance(chdir=True) as p: + c = p.pipenv("install sqlalchemy==1.2.0b3") + assert c.return_code != 0 + c = p.pipenv("install --pre sqlalchemy==1.2.0b3") + assert c.return_code == 0 + assert p.lockfile["default"]["sqlalchemy"]["version"] == "1.2.0b3" From 88921663176a2d99791d77b034bcf07385426d79 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Sat, 3 Aug 2019 11:18:17 +0800 Subject: [PATCH 02/46] mistook Mapping --- pipenv/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pipenv/core.py b/pipenv/core.py index 67a45197..e92b762c 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1772,6 +1772,7 @@ def do_outdated(pypi_mirror=None, pre=False, clear=False): from .vendor.requirementslib.models.requirements import Requirement from .vendor.requirementslib.models.utils import get_version from .vendor.packaging.utils import canonicalize_name + from .vendor.vistir.compat import Mapping from collections import namedtuple packages = {} From c3b4c410fa6cb2baeb6d51c309e3e5fa364d9172 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Sat, 3 Aug 2019 11:42:07 +0800 Subject: [PATCH 03/46] change the version specifier --- tests/integration/test_cli.py | 2 +- tests/integration/test_install_basic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 4d930fc3..c94f40c4 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -273,7 +273,7 @@ def test_pipenv_outdated_prerelease(PipenvInstance): with open(p.pipfile_path, "w") as f: contents = """ [packages] -sqlalchemy = "==1.2.0b3" +sqlalchemy = "<1.2.4" """.strip() f.write(contents) c = p.pipenv('update --pre --outdated') diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index f42b8f3f..90f2b37f 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -479,8 +479,8 @@ extras = ["socks"] @pytest.mark.install def test_install_prerelease(PipenvInstance): with PipenvInstance(chdir=True) as p: - c = p.pipenv("install sqlalchemy==1.2.0b3") + c = p.pipenv("install 'sqlalchemy<1.2.4'") assert c.return_code != 0 - c = p.pipenv("install --pre sqlalchemy==1.2.0b3") + c = p.pipenv("install --pre 'sqlalchemy<1.2.4'") assert c.return_code == 0 assert p.lockfile["default"]["sqlalchemy"]["version"] == "1.2.0b3" From 2dc8d0a0705d34cf3753fe994173d3398ae73b4a Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Sat, 3 Aug 2019 16:54:44 +0800 Subject: [PATCH 04/46] use another version --- tests/integration/test_cli.py | 2 +- tests/integration/test_install_basic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index c94f40c4..137ae892 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -273,7 +273,7 @@ def test_pipenv_outdated_prerelease(PipenvInstance): with open(p.pipfile_path, "w") as f: contents = """ [packages] -sqlalchemy = "<1.2.4" +sqlalchemy = "<=1.2.3" """.strip() f.write(contents) c = p.pipenv('update --pre --outdated') diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 90f2b37f..bbadf121 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -479,8 +479,8 @@ extras = ["socks"] @pytest.mark.install def test_install_prerelease(PipenvInstance): with PipenvInstance(chdir=True) as p: - c = p.pipenv("install 'sqlalchemy<1.2.4'") + c = p.pipenv("install 'sqlalchemy<=1.2.3'") assert c.return_code != 0 - c = p.pipenv("install --pre 'sqlalchemy<1.2.4'") + c = p.pipenv("install --pre 'sqlalchemy<=1.2.3'") assert c.return_code == 0 assert p.lockfile["default"]["sqlalchemy"]["version"] == "1.2.0b3" From f9cef970761c657d4b4335be7e4a724a0c000e7b Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Sat, 3 Aug 2019 18:17:10 +0800 Subject: [PATCH 05/46] Remove tricky test case --- tests/integration/test_install_basic.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index bbadf121..a6beb21d 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -474,13 +474,3 @@ extras = ["socks"] assert 'six = {version = "*"}' in contents assert 'requests = {version = "*"' in contents assert 'plette = "*"' in contents - - -@pytest.mark.install -def test_install_prerelease(PipenvInstance): - with PipenvInstance(chdir=True) as p: - c = p.pipenv("install 'sqlalchemy<=1.2.3'") - assert c.return_code != 0 - c = p.pipenv("install --pre 'sqlalchemy<=1.2.3'") - assert c.return_code == 0 - assert p.lockfile["default"]["sqlalchemy"]["version"] == "1.2.0b3" From 89d4e5e23d7df51950e2867eafa54754218977b1 Mon Sep 17 00:00:00 2001 From: frostming Date: Mon, 5 Aug 2019 19:06:02 +0800 Subject: [PATCH 06/46] try fixing version spec --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5f36b459..f1e81bac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: Python27: - python.version: '2.7' + python.version: '2.7.16' python.architecture: x64 Python36: python.version: '3.6' From ae512d811e03494117d05844b1ede864be0d7768 Mon Sep 17 00:00:00 2001 From: frostming Date: Mon, 5 Aug 2019 19:11:42 +0800 Subject: [PATCH 07/46] remove workaround --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f1e81bac..919fbd9b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: Python27: - python.version: '2.7.16' + python.version: '2.7' python.architecture: x64 Python36: python.version: '3.6' @@ -40,7 +40,7 @@ jobs: python.architecture: x64 maxParallel: 4 steps: - - template: .azure-pipelines/steps/reinstall-pythons.yml +# - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/run-tests.yml parameters: vmImage: 'Ubuntu-16.04' From 2f94e4b760d493301ac8eddaf01eafd719d24174 Mon Sep 17 00:00:00 2001 From: frostming Date: Mon, 5 Aug 2019 19:23:53 +0800 Subject: [PATCH 08/46] remove all workaround steps --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 919fbd9b..636ea713 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,7 +40,6 @@ jobs: python.architecture: x64 maxParallel: 4 steps: -# - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/run-tests.yml parameters: vmImage: 'Ubuntu-16.04' @@ -52,7 +51,6 @@ jobs: python.version: '3.7' python.architecture: x64 steps: - - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/run-vendor-scripts.yml parameters: vmImage: 'Ubuntu-16.04' @@ -64,7 +62,6 @@ jobs: python.version: '3.7' python.architecture: x64 steps: - - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/build-package.yml parameters: vmImage: 'Ubuntu-16.04' From 0acafd84d2bb09f19af0652d012a9ff67143644b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Tomsa?= Date: Mon, 5 Aug 2019 18:13:19 +0200 Subject: [PATCH 09/46] Remove misleading code comment from docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the Specifying Versions section of the Basics documentation, there is a misleading code comment saying that requests~=1.2 is equivalent to requests~=1.2.0, which it isn’t. ~=1.2 is equivalent to >=1.2,<2.0, but ~=1.2.0 is equivalent to >=1.2.0,<1.3. Fixed by removing the comment. --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index a78df254..677a4716 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -188,7 +188,7 @@ You can specify versions of a package using the `Semantic Versioning scheme Date: Mon, 5 Aug 2019 18:27:02 +0200 Subject: [PATCH 10/46] Add new item for the changelog Added a pull request description file to the news folder. Marked as trivial. --- news/3885.trivial.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3885.trivial.rst diff --git a/news/3885.trivial.rst b/news/3885.trivial.rst new file mode 100644 index 00000000..7782e0c9 --- /dev/null +++ b/news/3885.trivial.rst @@ -0,0 +1 @@ +Remove a misleading code comment from Specifying Versions documentation. From c1612d99d7d67877c6c6cffef74b0b5d2ea69554 Mon Sep 17 00:00:00 2001 From: jxltom Date: Sun, 2 Dec 2018 20:06:52 +0800 Subject: [PATCH 11/46] Move CLI into separate part in docs --- docs/cli.rst | 8 ++++++++ docs/index.rst | 8 +------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 docs/cli.rst diff --git a/docs/cli.rst b/docs/cli.rst new file mode 100644 index 00000000..873c67d7 --- /dev/null +++ b/docs/cli.rst @@ -0,0 +1,8 @@ +.. _cli: + +Pipenv CLI Reference +====================================== + +.. click:: pipenv:cli + :prog: pipenv + :show-nested: diff --git a/docs/index.rst b/docs/index.rst index 5d78ecc7..6246d1a5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -120,6 +120,7 @@ Further Documentation Guides basics advanced + cli diagnose Contribution Guides @@ -131,13 +132,6 @@ Contribution Guides dev/philosophy dev/contributing -☤ Pipenv Usage --------------- - -.. click:: pipenv:cli - :prog: pipenv - :show-nested: - Indices and tables ================== From 8ec562efc412f2a62dae231061c1b58fffe0000a Mon Sep 17 00:00:00 2001 From: frostming Date: Fri, 16 Aug 2019 11:26:35 +0800 Subject: [PATCH 12/46] Add news entry --- news/3346.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3346.doc.rst diff --git a/news/3346.doc.rst b/news/3346.doc.rst new file mode 100644 index 00000000..c985f001 --- /dev/null +++ b/news/3346.doc.rst @@ -0,0 +1 @@ +Move CLI docs to its own page. From 2e1b350b4f37c8e2275081e8b939b4f329ccc15a Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 26 Aug 2019 21:21:50 -0400 Subject: [PATCH 13/46] Fix link to GIF in README.md, add descriptive alttext --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea2bf074..8be2052e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,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](https://s3.amazonaws.com/media.kennethreitz.com/pipenv.gif) +![GIF demonstrating Pipenv's usage](https://gist.githubusercontent.com/jlusk/855d611bbcfa2b159839db73d07f6ce9/raw/7f5743401809f7e630ee8ff458faa980e19924a0/pipenv.gif) The problems that Pipenv seeks to solve are multi-faceted: From 8459c242aa0594ef816c9ca19293ba9d7bb00e39 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 26 Aug 2019 21:26:45 -0400 Subject: [PATCH 14/46] Add news/3911.doc.rst --- news/3911.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3911.doc.rst diff --git a/news/3911.doc.rst b/news/3911.doc.rst new file mode 100644 index 00000000..a5ab134f --- /dev/null +++ b/news/3911.doc.rst @@ -0,0 +1 @@ +Fix link to GIF in README.md demonstrating Pipenv's usage, and add descriptive alt text. From abaa348addabb0f95b78620fb0d7a70ec0f7df84 Mon Sep 17 00:00:00 2001 From: alexanderbarbosa Date: Tue, 27 Aug 2019 22:11:07 -0300 Subject: [PATCH 15/46] Sidebar: Update git-legit to new url address --- docs/_templates/sidebarintro.html | 3 +-- docs/_templates/sidebarlogo.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 216eb345..67c83d0e 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -56,7 +56,7 @@
  • Requests: HTTP for Humans
  • Maya: Datetimes for Humans
  • Records: SQL for Humans
  • -
  • Legit: Git for Humans
  • +
  • Legit: Git for Humans
  • Tablib: Tabular Datasets
  • @@ -75,4 +75,3 @@
  • 日本語
  • Español
  • - diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 00fb20c4..d574633f 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -59,7 +59,7 @@
  • The Python Guide
  • Requests: HTTP for Humans
  • Records: SQL for Humans
  • -
  • Legit: Git for Humans
  • +
  • Legit: Git for Humans
  • Tablib: Tabular Datasets
  • Markdown, Please!
  • @@ -79,4 +79,3 @@
  • 日本語
  • Español
  • - From 7d36f3fbdab6fcf8340df8a2cf157bef9a8713ce Mon Sep 17 00:00:00 2001 From: frostming Date: Fri, 6 Sep 2019 16:07:54 +0800 Subject: [PATCH 16/46] Reformat codes --- pipenv/__init__.py | 4 +- pipenv/_compat.py | 6 +-- pipenv/cli/__init__.py | 2 +- pipenv/cli/command.py | 12 +++--- pipenv/core.py | 47 ++++++++++------------- pipenv/environment.py | 9 ++--- pipenv/exceptions.py | 15 ++++---- pipenv/project.py | 23 +++++------ pipenv/resolver.py | 9 ----- pipenv/utils.py | 38 ++++++++---------- pytest.ini | 25 ------------ setup.cfg | 33 +++++++++++++++- setup.py | 1 + tasks/__init__.py | 2 - tasks/release.py | 3 -- tasks/vendoring/__init__.py | 12 +----- tasks/vendoring/vendor_passa.py | 2 +- tests/integration/conftest.py | 25 ++++++------ tests/integration/test_cli.py | 2 +- tests/integration/test_dot_venv.py | 4 +- tests/integration/test_install_markers.py | 1 - tests/integration/test_install_twists.py | 2 - tests/integration/test_lock.py | 2 +- tests/integration/test_project.py | 1 - tests/integration/test_windows.py | 1 - tests/pytest-pypi/pytest_pypi/app.py | 1 - tests/pytest-pypi/pytest_pypi/certs.py | 1 + tests/pytest-pypi/pytest_pypi/plugin.py | 2 + tests/unit/test_patched.py | 1 + tests/unit/test_utils.py | 13 ++----- 30 files changed, 126 insertions(+), 173 deletions(-) delete mode 100644 pytest.ini diff --git a/pipenv/__init__.py b/pipenv/__init__.py index 31d49fc1..624397c5 100644 --- a/pipenv/__init__.py +++ b/pipenv/__init__.py @@ -8,7 +8,7 @@ import os import sys import warnings -from .__version__ import __version__ +from .__version__ import __version__ # noqa PIPENV_ROOT = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) @@ -53,7 +53,7 @@ sys.stdout = stdout sys.stderr = stderr from .cli import cli -from . import resolver +from . import resolver # noqa if __name__ == "__main__": cli() diff --git a/pipenv/_compat.py b/pipenv/_compat.py index caba80fe..fdcca7f5 100644 --- a/pipenv/_compat.py +++ b/pipenv/_compat.py @@ -4,8 +4,6 @@ Exposes a standard API that enables compatibility across python versions, operating systems, etc. """ - -import os import sys import warnings @@ -132,7 +130,7 @@ def decode_output(output): output = output.encode(DEFAULT_ENCODING) except (AttributeError, UnicodeDecodeError, UnicodeEncodeError): if six.PY2: - output = unicode.translate(vistir.misc.to_text(output), + output = unicode.translate(vistir.misc.to_text(output), # noqa UNICODE_TO_ASCII_TRANSLATION_MAP) else: output = output.translate(UNICODE_TO_ASCII_TRANSLATION_MAP) @@ -147,5 +145,5 @@ def fix_utf8(text): text = decode_output(text) except UnicodeDecodeError: if six.PY2: - text = unicode.translate(vistir.misc.to_text(text), UNICODE_TO_ASCII_TRANSLATION_MAP) + text = unicode.translate(vistir.misc.to_text(text), UNICODE_TO_ASCII_TRANSLATION_MAP) # noqa return text diff --git a/pipenv/cli/__init__.py b/pipenv/cli/__init__.py index d1819953..0f57e306 100644 --- a/pipenv/cli/__init__.py +++ b/pipenv/cli/__init__.py @@ -1,4 +1,4 @@ # -*- coding=utf-8 -*- from __future__ import absolute_import -from .command import cli +from .command import cli # noqa diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 3fa6b611..293822a8 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -8,17 +8,15 @@ from click import ( argument, echo, edit, group, option, pass_context, secho, version_option ) -from ..vendor import click_completion -from ..vendor import delegator -from ..patched import crayons - from ..__version__ import __version__ +from ..patched import crayons +from ..vendor import click_completion, delegator from .options import ( CONTEXT_SETTINGS, PipenvGroup, code_option, common_options, deploy_option, general_options, install_options, lock_options, pass_state, - pypi_mirror_option, python_option, requirementstxt_option, - skip_lock_option, sync_options, system_option, three_option, - uninstall_options, verbose_option, site_packages_option + pypi_mirror_option, python_option, site_packages_option, skip_lock_option, + sync_options, system_option, three_option, uninstall_options, + verbose_option ) diff --git a/pipenv/core.py b/pipenv/core.py index e92b762c..3e299c8d 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1,49 +1,48 @@ # -*- coding=utf-8 -*- from __future__ import absolute_import, print_function + import io import json as simplejson import logging import os -import shutil import sys import time import warnings import click import six -import urllib3.util as urllib3_util -import vistir -from click_completion import init as init_completion import delegator import dotenv import pipfile +import vistir + +from click_completion import init as init_completion -from .patched import crayons from . import environments, exceptions, pep508checker, progress -from ._compat import fix_utf8, decode_for_output +from ._compat import decode_for_output, fix_utf8 from .cmdparse import Script from .environments import ( - PIPENV_CACHE_DIR, PIPENV_COLORBLIND, PIPENV_DEFAULT_PYTHON_VERSION, - PIPENV_DONT_USE_PYENV, PIPENV_HIDE_EMOJIS, PIPENV_MAX_SUBPROCESS, - PIPENV_PYUP_API_KEY, PIPENV_SHELL_FANCY, PIPENV_SKIP_VALIDATION, - PIPENV_YES, SESSION_IS_INTERACTIVE, PIP_EXISTS_ACTION, PIPENV_RESOLVE_VCS, - is_type_checking + PIP_EXISTS_ACTION, PIPENV_CACHE_DIR, PIPENV_COLORBLIND, + PIPENV_DEFAULT_PYTHON_VERSION, PIPENV_DONT_USE_PYENV, PIPENV_HIDE_EMOJIS, + PIPENV_MAX_SUBPROCESS, PIPENV_PYUP_API_KEY, PIPENV_RESOLVE_VCS, + PIPENV_SHELL_FANCY, PIPENV_SKIP_VALIDATION, PIPENV_YES, + SESSION_IS_INTERACTIVE, is_type_checking ) -from .project import Project, SourceNotFound +from .patched import crayons +from .project import Project from .utils import ( - convert_deps_to_pip, create_mirror_source, create_spinner, download_file, - escape_cmd, escape_grouped_arguments, find_windows_executable, - get_canonical_names, is_pinned, is_pypi_url, is_required_version, is_star, - is_valid_url, parse_indexes, pep423_name, prepare_pip_source_args, - proper_case, python_version, venv_resolve_deps, run_command, - is_python_command, find_python, make_posix, interrupt_handled_subprocess, - get_indexes_from_requirement, get_source_list, get_project_index, + convert_deps_to_pip, create_spinner, download_file, + escape_grouped_arguments, find_python, find_windows_executable, + get_canonical_names, get_source_list, interrupt_handled_subprocess, + is_pinned, is_python_command, is_required_version, is_star, is_valid_url, + parse_indexes, pep423_name, prepare_pip_source_args, proper_case, + python_version, run_command, venv_resolve_deps ) if is_type_checking(): - from typing import Dict, List, Mapping, Optional, Union, Text + from typing import Dict, List, Optional, Union, Text from pipenv.vendor.requirementslib.models.requirements import Requirement TSourceDict = Dict[Text, Union[Text, bool]] @@ -711,8 +710,6 @@ def batch_install(deps_list, procs, failed_deps_queue, label=label ) - - indexes = [] trusted_hosts = [] # Install these because for dep in deps_list_bar: @@ -723,9 +720,6 @@ def batch_install(deps_list, procs, failed_deps_queue, dep.markers = str(strip_extras_markers_from_requirement(dep.get_markers())) # Install the module. is_artifact = False - if no_deps: - link = getattr(dep.req, "link", None) - is_wheel = getattr(link, "is_wheel", False) if link else False if dep.is_file_or_url and (dep.is_direct_url or any( dep.req.uri.endswith(ext) for ext in ["zip", "tar.gz"] )): @@ -1053,7 +1047,6 @@ def do_lock( # Resolve dev-package dependencies, with pip-tools. for is_dev in [True, False]: pipfile_section = "dev-packages" if is_dev else "packages" - lockfile_section = "develop" if is_dev else "default" if project.pipfile_exists: packages = project.parsed_pipfile.get(pipfile_section, {}) else: @@ -1355,7 +1348,7 @@ def get_requirement_line( return ["-e", line] return '-e {0}'.format(line) if not format_for_file: - return [line,] + return [line] return line return requirement.as_line(include_hashes=include_hashes, as_list=not format_for_file) diff --git a/pipenv/environment.py b/pipenv/environment.py index 4a694019..a1a28bf5 100644 --- a/pipenv/environment.py +++ b/pipenv/environment.py @@ -10,7 +10,6 @@ import os import site import sys -from distutils.sysconfig import get_python_lib from sysconfig import get_paths, get_python_version import itertools @@ -620,7 +619,7 @@ class Environment(object): else: d['required_version'] = d['installed_version'] - get_children = lambda n: key_tree.get(n.key, []) + get_children = lambda n: key_tree.get(n.key, []) # noqa d['dependencies'] = [ cls._get_requirements_for_package(c, key_tree, parent=node, @@ -805,7 +804,7 @@ class Environment(object): sys.path = self.sys_path sys.prefix = self.sys_prefix site.addsitedir(self.base_paths["purelib"]) - pip = self.safe_import("pip") + pip = self.safe_import("pip") # noqa pip_vendor = self.safe_import("pip._vendor") pep517_dir = os.path.join(os.path.dirname(pip_vendor.__file__), "pep517") site.addsitedir(pep517_dir) @@ -865,7 +864,7 @@ class Environment(object): def install(self, requirements): if not isinstance(requirements, (tuple, list)): - requirements = [requirements,] + requirements = [requirements] with self.get_finder() as finder: args = [] for format_control in ('no_binary', 'only_binary'): @@ -925,7 +924,7 @@ class Environment(object): pathset.remove(auto_confirm=auto_confirm, verbose=verbose) try: yield pathset - except Exception as e: + except Exception: if pathset is not None: pathset.rollback() else: diff --git a/pipenv/exceptions.py b/pipenv/exceptions.py index c8ca0dc8..6e0032ad 100644 --- a/pipenv/exceptions.py +++ b/pipenv/exceptions.py @@ -84,7 +84,7 @@ class PipenvException(ClickException): file = vistir.misc.get_text_stderr() if self.extra: if isinstance(self.extra, STRING_TYPES): - self.extra = [self.extra,] + self.extra = [self.extra] for extra in self.extra: extra = "[pipenv.exceptions.{0!s}]: {1}".format( self.__class__.__name__, extra @@ -163,14 +163,13 @@ class PipenvUsageError(UsageError): color = self.ctx.color if self.extra: if isinstance(self.extra, STRING_TYPES): - self.extra = [self.extra,] + self.extra = [self.extra] for extra in self.extra: if color: extra = getattr(crayons, color, "blue")(extra) click_echo(decode_for_output(extra, file), file=file) hint = '' - if (self.cmd is not None and - self.cmd.get_help_option(self.ctx) is not None): + if self.cmd is not None and self.cmd.get_help_option(self.ctx) is not None: hint = ('Try "%s %s" for help.\n' % (self.ctx.command_path, self.ctx.help_option_names[0])) if self.ctx is not None: @@ -199,7 +198,7 @@ class PipenvFileError(FileError): file = vistir.misc.get_text_stderr() if self.extra: if isinstance(self.extra, STRING_TYPES): - self.extra = [self.extra,] + self.extra = [self.extra] for extra in self.extra: click_echo(decode_for_output(extra, file), file=file) click_echo(self.message, file=file) @@ -312,7 +311,7 @@ class VirtualenvCreationException(VirtualenvException): extra = ANSI_REMOVAL_RE.sub("", "{0}".format(extra)) if "KeyboardInterrupt" in extra: extra = crayons.red("Virtualenv creation interrupted by user", bold=True) - self.extra = extra = [extra,] + self.extra = extra = [extra] VirtualenvException.__init__(self, message, extra=extra) @@ -321,9 +320,9 @@ class UninstallError(PipenvException): extra = [ "{0} {1}".format( crayons.blue("Attempted to run command: "), - crayons.yellow("$ {0!r}".format(command), bold=True + crayons.yellow("$ {0!r}".format(command), bold=True) ) - )] + ] extra.extend([crayons.blue(line.strip()) for line in return_values.splitlines()]) if isinstance(package, (tuple, list, set)): package = " ".join(package) diff --git a/pipenv/project.py b/pipenv/project.py index c4b0c941..5b14106e 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -15,8 +15,6 @@ import toml import tomlkit import vistir -from first import first - import pipfile import pipfile.api @@ -209,14 +207,12 @@ class Project(object): # First exclude anything that is a vcs entry either in the key or value if not ( any(is_vcs(i) for i in [k, v]) - or # Then exclude any installable files that are not directories # Because pip-tools can resolve setup.py for example - any(is_installable_file(i) for i in [k, v]) - or + or any(is_installable_file(i) for i in [k, v]) # Then exclude any URLs because they need to be editable also # Things that are excluded can only be 'shallow resolved' - any(is_valid_url(i) for i in [k, v]) + or any(is_valid_url(i) for i in [k, v]) ): ps.update({k: v}) return ps @@ -337,7 +333,7 @@ class Project(object): if not self._environment: prefix = self.virtualenv_location is_venv = is_in_virtualenv() - sources = self.sources if self.sources else [DEFAULT_SOURCE,] + sources = self.sources if self.sources else [DEFAULT_SOURCE] self._environment = Environment( prefix=prefix, is_venv=is_venv, sources=sources, pipfile=self.parsed_pipfile, project=self @@ -421,8 +417,10 @@ class Project(object): def virtualenv_location(self): # if VIRTUAL_ENV is set, use that. virtualenv_env = os.getenv("VIRTUAL_ENV") - if ("PIPENV_ACTIVE" not in os.environ and - not PIPENV_IGNORE_VIRTUALENVS and virtualenv_env): + if ( + "PIPENV_ACTIVE" not in os.environ + and not PIPENV_IGNORE_VIRTUALENVS and virtualenv_env + ): return virtualenv_env if not self._virtualenv_location: # Use cached version, if available. @@ -542,7 +540,6 @@ class Project(object): def build_requires(self): return self._build_system.get("requires", ["setuptools>=40.8.0", "wheel"]) - @property def build_backend(self): return self._build_system.get("build-backend", get_default_pyproject_backend()) @@ -688,7 +685,7 @@ class Project(object): .lstrip("\n") .split("\n") ) - sources = [DEFAULT_SOURCE,] + sources = [DEFAULT_SOURCE] for i, index in enumerate(indexes): if not index: continue @@ -756,7 +753,7 @@ class Project(object): if not sources: sources = self.pipfile_sources elif not isinstance(sources, list): - sources = [sources,] + sources = [sources] lockfile_dict["_meta"]["sources"] = [ self.populate_source(s) for s in sources ] @@ -775,7 +772,7 @@ class Project(object): else: sources = [dict(source) for source in self.parsed_pipfile["source"]] if not isinstance(sources, list): - sources = [sources,] + sources = [sources] return { "hash": {"sha256": self.calculate_pipfile_hash()}, "pipfile-spec": PIPFILE_SPEC_CURRENT, diff --git a/pipenv/resolver.py b/pipenv/resolver.py index 1219cc24..cd04fccb 100644 --- a/pipenv/resolver.py +++ b/pipenv/resolver.py @@ -516,7 +516,6 @@ class Entry(object): :raises: :exc:`~pipenv.exceptions.DependencyConflict` if resolution is impossible """ # ensure that we satisfy the parent dependencies of this dep - from pipenv.vendor.packaging.specifiers import Specifier parent_dependencies = set() has_mismatch = False can_use_original = True @@ -527,7 +526,6 @@ class Entry(object): # parents with no requirements can't conflict if not p.requirements: continue - needed = p.requirements.get("dependencies", []) entry_ref = p.get_dependency(self.name) required = entry_ref.get("required_version", "*") required = self.clean_specifier(required) @@ -633,7 +631,6 @@ def clean_results(results, resolver, project, dev=False): return results lockfile = project.lockfile_content section = "develop" if dev else "default" - pipfile_section = "dev-packages" if dev else "packages" reverse_deps = project.environment.reverse_dependencies() new_results = [r for r in results if r["name"] not in lockfile[section]] for result in results: @@ -646,17 +643,11 @@ def clean_results(results, resolver, project, dev=False): def clean_outdated(results, resolver, project, dev=False): - from pipenv.vendor.requirementslib.models.requirements import Requirement - from pipenv.environments import is_verbose if not project.lockfile_exists: return results lockfile = project.lockfile_content section = "develop" if dev else "default" - pipfile_section = "dev-packages" if dev else "packages" - pipfile = project.parsed_pipfile[pipfile_section] reverse_deps = project.environment.reverse_dependencies() - deptree = project.environment.get_package_requirements() - overlapping_results = [r for r in results if r["name"] in lockfile[section]] new_results = [r for r in results if r["name"] not in lockfile[section]] for result in results: name = result.get("name") diff --git a/pipenv/utils.py b/pipenv/utils.py index 2b0a8cdb..f263ee9f 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -1,46 +1,41 @@ # -*- coding: utf-8 -*- from __future__ import print_function + import contextlib import errno import logging import os import posixpath import re -import signal import shutil +import signal import stat import sys import warnings - from contextlib import contextmanager from distutils.spawn import find_executable import six import toml -import tomlkit - from click import echo as click_echo from six.moves.urllib.parse import urlparse -from .vendor.vistir.compat import ResourceWarning, lru_cache, Mapping, Sequence, Set -from .vendor.vistir.misc import fs_str, run import crayons import parse +import tomlkit from . import environments -from .exceptions import ( - PipenvUsageError, RequirementError, PipenvCmdError, ResolutionFailure -) +from .exceptions import PipenvCmdError, PipenvUsageError, RequirementError, ResolutionFailure from .pep508checker import lookup +from .vendor.packaging.markers import Marker from .vendor.urllib3 import util as urllib3_util - +from .vendor.vistir.compat import Mapping, ResourceWarning, Sequence, Set, lru_cache +from .vendor.vistir.misc import fs_str, run if environments.MYPY_RUNNING: from typing import Tuple, Dict, Any, List, Union, Optional, Text from .vendor.requirementslib.models.requirements import Requirement, Line from .vendor.requirementslib.models.pipfile import Pipfile - from .vendor.packaging.markers import Marker - from .vendor.packaging.specifiers import Specifier from .project import Project, TSource @@ -316,7 +311,7 @@ def get_source_list( sources.append(get_project_index(index)) if extra_indexes: if isinstance(extra_indexes, six.string_types): - extra_indexes = [extra_indexes,] + extra_indexes = [extra_indexes] for source in extra_indexes: extra_src = get_project_index(source) if not sources or extra_src["url"] != sources[0]["url"]: @@ -555,8 +550,8 @@ class Resolver(object): # but leave it on for local, installable folders on the filesystem if environments.PIPENV_RESOLVE_VCS or ( req.editable or parsed_line.is_wheel or ( - req.is_file_or_url and parsed_line.is_local and - is_installable_dir(parsed_line.path) + req.is_file_or_url and parsed_line.is_local + and is_installable_dir(parsed_line.path) ) ): requirements = [v for v in getattr(setup_info, "requires", {}).values()] @@ -920,8 +915,10 @@ class Resolver(object): # We also don't want to try to hash directories as this will fail # as these are editable deps and are not hashable. - if (ireq.link.scheme == "file" and - Path(to_native_string(url_to_path(ireq.link.url))).is_dir()): + if ( + ireq.link.scheme == "file" + and Path(to_native_string(url_to_path(ireq.link.url))).is_dir() + ): return False return True @@ -1069,7 +1066,6 @@ def actually_resolve_deps( req_dir=None, ): from pipenv.vendor.vistir.path import create_tracked_tempdir - from pipenv.vendor.requirementslib.models.requirements import Requirement if not req_dir: req_dir = create_tracked_tempdir(suffix="-requirements", prefix="pipenv-") @@ -1889,7 +1885,7 @@ def translate_markers(pipfile_entry): """ if not isinstance(pipfile_entry, Mapping): raise TypeError("Entry is not a pipfile formatted mapping.") - from .vendor.packaging.markers import Marker, default_environment + from .vendor.packaging.markers import default_environment from .vendor.vistir.misc import dedup allowed_marker_keys = ["markers"] + list(default_environment().keys()) @@ -2217,8 +2213,8 @@ def is_python_command(line): from pipenv.vendor.pythonfinder.utils import PYTHON_IMPLEMENTATIONS is_version = re.match(r'[\d\.]+', line) - if (line.startswith("python") or is_version or - any(line.startswith(v) for v in PYTHON_IMPLEMENTATIONS)): + if (line.startswith("python") or is_version + or any(line.startswith(v) for v in PYTHON_IMPLEMENTATIONS)): return True # we are less sure about this but we can guess if line.startswith("py"): diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index da966ec9..00000000 --- a/pytest.ini +++ /dev/null @@ -1,25 +0,0 @@ -[pytest] -addopts = -ra -n auto -plugins = xdist -testpaths = tests -; Add vendor and patched in addition to the default list of ignored dirs -; Additionally, ignore tasks, news, test subdirectories and peeps directory -norecursedirs = - .* build - dist - CVS - _darcs - {arch} - *.egg - vendor - patched - news - tasks - docs - tests/test_artifacts - tests/pytest-pypi - tests/pypi - peeps -filterwarnings = - ignore::DeprecationWarning - ignore::PendingDeprecationWarning diff --git a/setup.cfg b/setup.cfg index 896a5a91..fbc691d4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,9 @@ license = MIT license_file = LICENSE [flake8] -exclude = .git,__pycache__,docs/,pipenv/vendor/,get-pipenv.py,setup.py +exclude = + .git,__pycache__,docs/,pipenv/vendor/,pipenv/patched,get-pipenv.py, + .eggs/,setup.py,tests/fixtures/ ignore = # The default ignore list: E121,E123,E126,E226,E24,E704, @@ -17,13 +19,14 @@ ignore = # E402: module level import not at top of file # E501: line too long # W503: line break before binary operator - E402,E501,W503 + E402,E501,W503,E203 [isort] atomic=true lines_after_imports=2 lines_between_types=1 multi_line_output=5 +line_length=80 not_skip=__init__.py known_first_party = pipenv @@ -36,3 +39,29 @@ follow_imports=skip html_report=mypyhtml python_version=3.6 mypy_path=typeshed/pyi:typeshed/imports + +[tool:pytest] +addopts = -ra -n auto +plugins = xdist +testpaths = tests +; Add vendor and patched in addition to the default list of ignored dirs +; Additionally, ignore tasks, news, test subdirectories and peeps directory +norecursedirs = + .* build + dist + CVS + _darcs + {arch} + *.egg + vendor + patched + news + tasks + docs + tests/test_artifacts + tests/pytest-pypi + tests/pypi + peeps +filterwarnings = + ignore::DeprecationWarning + ignore::PendingDeprecationWarning diff --git a/setup.py b/setup.py index d86d85e0..dd8d4f71 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ extras = { "tests": ["pytest<5.0", "pytest-tap", "pytest-xdist", "flaky", "mock"], } + # https://pypi.python.org/pypi/stdeb/0.8.5#quickstart-2-just-tell-me-the-fastest-way-to-make-a-deb class DebCommand(Command): """Support for setup.py deb""" diff --git a/tasks/__init__.py b/tasks/__init__.py index 63fe1388..d81d101d 100644 --- a/tasks/__init__.py +++ b/tasks/__init__.py @@ -1,8 +1,6 @@ # -*- coding=utf-8 -*- # Copied from pip's vendoring process # see https://github.com/pypa/pip/blob/95bcf8c5f6394298035a7332c441868f3b0169f4/tasks/__init__.py -import re - from pathlib import Path import invoke diff --git a/tasks/release.py b/tasks/release.py index 610a36a9..c43a7c85 100644 --- a/tasks/release.py +++ b/tasks/release.py @@ -3,7 +3,6 @@ import datetime import os import pathlib import re -import sys import invoke @@ -240,8 +239,6 @@ def bump_version(ctx, dry_run=False, dev=False, pre=False, tag=None, commit=Fals current_version = Version.parse(__version__) today = datetime.date.today() tomorrow = today + datetime.timedelta(days=1) - next_month = datetime.date.today().replace(month=today.month + 1, day=1) - next_year = datetime.date.today().replace(year=today.year + 1, month=1, day=1) if pre and not tag: print('Using "pre" requires a corresponding tag.') return diff --git a/tasks/vendoring/__init__.py b/tasks/vendoring/__init__.py index 69398450..8329ba4e 100644 --- a/tasks/vendoring/__init__.py +++ b/tasks/vendoring/__init__.py @@ -41,7 +41,7 @@ LIBRARY_DIRNAMES = { 'enum': 'backports/enum' } -PY2_DOWNLOAD = ['enum34',] +PY2_DOWNLOAD = ['enum34'] # from time to time, remove the no longer needed ones HARDCODED_LICENSE_URLS = { @@ -93,7 +93,6 @@ LICENSE_RENAMES = { } - def drop_dir(path): if path.exists() and path.is_dir(): shutil.rmtree(str(path), ignore_errors=True) @@ -379,7 +378,6 @@ def vendor(ctx, vendor_dir, package=None, rewrite=True): post_install_cleanup(ctx, vendor_dir) # Detect the vendored packages/modules vendored_libs = detect_vendored_libs(_get_vendor_dir(ctx)) - patched_libs = detect_vendored_libs(_get_patched_dir(ctx)) log("Detected vendored libraries: %s" % ", ".join(vendored_libs)) # Apply pre-patches @@ -509,14 +507,6 @@ def download_licenses( new_requirements_file = fh.name new_requirements_file = Path(new_requirements_file) log(requirements) - requirement = "-r {0}".format(new_requirements_file.as_posix()) - if package: - if not only: - # for packages we want to add to the requirements file - requirement = _ensure_package_in_requirements(ctx, requirements_file, package) - else: - # for packages we want to get the license for by themselves - requirement = package tmp_dir = vendor_dir / '__tmp__' # TODO: Fix this whenever it gets sorted out (see https://github.com/pypa/pip/issues/5739) cmd = "pip download --no-binary :all: --only-binary requests_download --no-deps" diff --git a/tasks/vendoring/vendor_passa.py b/tasks/vendoring/vendor_passa.py index f2c58745..2da91259 100644 --- a/tasks/vendoring/vendor_passa.py +++ b/tasks/vendoring/vendor_passa.py @@ -2,7 +2,7 @@ import invoke from pipenv._compat import TemporaryDirectory -from . import _get_git_root, _get_vendor_dir, log +from . import _get_vendor_dir, log @invoke.task diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index b05eacfa..53973d34 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -1,30 +1,34 @@ # -*- coding=utf-8 -*- from __future__ import absolute_import, print_function + import errno import json import logging import os import shutil -import signal -import socket import sys -import time import warnings -from shutil import copyfileobj, rmtree as _rmtree +from shutil import rmtree as _rmtree import pytest import requests -from pipenv.vendor.vistir.compat import ResourceWarning, fs_str, fs_encode, FileNotFoundError, PermissionError, TemporaryDirectory -from pipenv.vendor.vistir.misc import run -from pipenv.vendor.vistir.contextmanagers import temp_environ -from pipenv.vendor.vistir.path import mkdir_p, create_tracked_tempdir, handle_remove_readonly - from pipenv._compat import Path from pipenv.exceptions import VirtualenvActivationException from pipenv.vendor import delegator, toml, tomlkit -from pytest_pypi.app import prepare_fixtures, prepare_packages as prepare_pypi_packages +from pipenv.vendor.vistir.compat import ( + FileNotFoundError, PermissionError, ResourceWarning, TemporaryDirectory, + fs_encode, fs_str +) +from pipenv.vendor.vistir.contextmanagers import temp_environ +from pipenv.vendor.vistir.misc import run +from pipenv.vendor.vistir.path import ( + create_tracked_tempdir, handle_remove_readonly, mkdir_p +) +from pytest_pypi.app import prepare_fixtures +from pytest_pypi.app import prepare_packages as prepare_pypi_packages + log = logging.getLogger(__name__) warnings.simplefilter("default", category=ResourceWarning) @@ -399,7 +403,6 @@ class _PipenvInstance(object): def _rmtree_func(path, ignore_errors=True, onerror=None): directory = fs_encode(path) - global _rmtree shutil_rmtree = _rmtree if onerror is None: onerror = handle_remove_readonly diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 137ae892..04253fc5 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -223,7 +223,7 @@ def test_install_parse_error(PipenvInstance): [dev-packages] """.strip() f.write(contents) - c = p.pipenv('install requests u/\\/p@r\$34b13+pkg') + c = p.pipenv('install requests u/\\/p@r\\$34b13+pkg') assert c.return_code != 0 assert 'u/\\/p@r$34b13+pkg' not in p.pipfile['packages'] diff --git a/tests/integration/test_dot_venv.py b/tests/integration/test_dot_venv.py index aa52dd5e..3cbc88db 100644 --- a/tests/integration/test_dot_venv.py +++ b/tests/integration/test_dot_venv.py @@ -5,9 +5,7 @@ import os import pytest from pipenv._compat import Path, TemporaryDirectory -from pipenv.project import Project -from pipenv.utils import get_windows_path, normalize_drive, temp_environ -from pipenv.vendor import delegator +from pipenv.utils import normalize_drive, temp_environ @pytest.mark.dotvenv diff --git a/tests/integration/test_install_markers.py b/tests/integration/test_install_markers.py index 00f9c789..de3ba193 100644 --- a/tests/integration/test_install_markers.py +++ b/tests/integration/test_install_markers.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import os -import sys import pytest diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index 44973df5..4fcbd4c5 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -9,7 +9,6 @@ import pytest from flaky import flaky from pipenv._compat import Path -from pipenv.project import Project from pipenv.utils import mkdir_p, temp_environ from pipenv.vendor import delegator @@ -40,7 +39,6 @@ setup( """.strip() fh.write(contents) line = "-e .[dev]" - pipfile = {"testpipenv": {"path": ".", "editable": True, "extras": ["dev"]}} with open(os.path.join(p.path, 'Pipfile'), 'w') as fh: fh.write(""" [packages] diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index 4c227395..5c6af0fa 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -659,4 +659,4 @@ six = "*" c = p.pipenv("lock --clear") assert c.return_code == 0 assert "index" in p.lockfile["default"]["six"] - assert p.lockfile["default"]["six"]["index"] == "custom", Path(p.lockfile_path).read_text() # p.lockfile["default"]["six"] + assert p.lockfile["default"]["six"]["index"] == "custom", Path(p.lockfile_path).read_text() # p.lockfile["default"]["six"] diff --git a/tests/integration/test_project.py b/tests/integration/test_project.py index f7b0e460..bef9912f 100644 --- a/tests/integration/test_project.py +++ b/tests/integration/test_project.py @@ -11,7 +11,6 @@ from pipenv.project import Project from pipenv.utils import temp_environ from pipenv.vendor.vistir.path import is_in_path from pipenv.vendor.delegator import run as delegator_run -import pipenv.environments @pytest.mark.project diff --git a/tests/integration/test_windows.py b/tests/integration/test_windows.py index b303d0ab..a74be386 100644 --- a/tests/integration/test_windows.py +++ b/tests/integration/test_windows.py @@ -5,7 +5,6 @@ import os import pytest from pipenv._compat import Path -from pipenv.project import Project # This module is run only on Windows. diff --git a/tests/pytest-pypi/pytest_pypi/app.py b/tests/pytest-pypi/pytest_pypi/app.py index 95dbd076..5484eeb7 100644 --- a/tests/pytest-pypi/pytest_pypi/app.py +++ b/tests/pytest-pypi/pytest_pypi/app.py @@ -4,7 +4,6 @@ import contextlib import io import json import os -import sys from tarfile import is_tarfile from zipfile import is_zipfile diff --git a/tests/pytest-pypi/pytest_pypi/certs.py b/tests/pytest-pypi/pytest_pypi/certs.py index f9e33870..b73fc63a 100644 --- a/tests/pytest-pypi/pytest_pypi/certs.py +++ b/tests/pytest-pypi/pytest_pypi/certs.py @@ -17,5 +17,6 @@ def where(): # vendored bundle inside Requests return os.path.join(os.path.abspath(os.path.dirname(__file__)), 'certs', 'cacert.pem') + if __name__ == '__main__': print(where()) diff --git a/tests/pytest-pypi/pytest_pypi/plugin.py b/tests/pytest-pypi/pytest_pypi/plugin.py index a17fcb24..83cd73fb 100644 --- a/tests/pytest-pypi/pytest_pypi/plugin.py +++ b/tests/pytest-pypi/pytest_pypi/plugin.py @@ -3,6 +3,7 @@ import pytest from .app import app as pypi_app from . import serve, certs + @pytest.fixture(scope='session') def pypi(request): server = serve.Server(application=pypi_app) @@ -31,6 +32,7 @@ def pypi_both(request, pypi, pypi_secure): def class_based_pypi(request, pypi): request.cls.pypi = pypi + @pytest.fixture(scope='class') def class_based_pypi_secure(request, pypi_secure): request.cls.pypi_secure = pypi_secure diff --git a/tests/unit/test_patched.py b/tests/unit/test_patched.py index 249292b4..03e1c039 100644 --- a/tests/unit/test_patched.py +++ b/tests/unit/test_patched.py @@ -122,6 +122,7 @@ get_extras_links_scenarios = { ), } + @pytest.mark.parametrize( 'scenarios,expected', list(get_extras_links_scenarios.values()), diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 18cb94a8..f3a567da 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -3,11 +3,7 @@ import os import pytest -from first import first -from mock import Mock, patch - import pipenv.utils -import pythonfinder.utils from pipenv.exceptions import PipenvUsageError @@ -129,11 +125,8 @@ def test_convert_deps_to_pip(monkeypatch, deps, expected): ), ], ) -def test_convert_deps_to_pip_one_way(monkeypatch, deps, expected): - with monkeypatch.context() as m: - import pip_shims - # m.setattr(pip_shims.shims, "unpack_url", mock_unpack) - assert pipenv.utils.convert_deps_to_pip(deps, r=False) == [expected.lower()] +def test_convert_deps_to_pip_one_way(deps, expected): + assert pipenv.utils.convert_deps_to_pip(deps, r=False) == [expected.lower()] @pytest.mark.skipif(isinstance(u"", str), reason="don't need to test if unicode is str") @@ -218,7 +211,7 @@ class TestUtils: @pytest.mark.windows @pytest.mark.skipif(os.name != "nt", reason="Windows test only") def test_windows_shellquote(self): - test_path = "C:\Program Files\Python36\python.exe" + test_path = r"C:\Program Files\Python36\python.exe" expected_path = '"C:\\\\Program Files\\\\Python36\\\\python.exe"' assert pipenv.utils.escape_grouped_arguments(test_path) == expected_path From 589eead7bc8d177c81a77644c7cbc7a55a18bd15 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Sat, 7 Sep 2019 22:37:03 +0530 Subject: [PATCH 17/46] Doc: Add python_version value --- docs/basics.rst | 2 +- news/3912.doc.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 news/3912.doc.rst diff --git a/docs/basics.rst b/docs/basics.rst index 677a4716..008c08a5 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -125,7 +125,7 @@ Example Pipfile.lock - Generally, keep both ``Pipfile`` and ``Pipfile.lock`` in version control. - Do not keep ``Pipfile.lock`` in version control if multiple versions of Python are being targeted. -- Specify your target Python version in your `Pipfile`'s ``[requires]`` section. Ideally, you should only have one target Python version, as this is a deployment tool. +- Specify your target Python version in your `Pipfile`'s ``[requires]`` section. Ideally, you should only have one target Python version, as this is a deployment tool. ``python_version`` can be ``>`` Python 2.7 and ``<`` Python 3.7. - ``pipenv install`` is fully compatible with ``pip install`` syntax, for which the full documentation can be found `here `_. - Note that the ``Pipfile`` uses the `TOML Spec `_. diff --git a/news/3912.doc.rst b/news/3912.doc.rst new file mode 100644 index 00000000..55c13b35 --- /dev/null +++ b/news/3912.doc.rst @@ -0,0 +1 @@ +Define python_version value. From b0a683926e8b9395a41f8e941108e5742dc09eec Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Sat, 7 Sep 2019 23:33:23 +0530 Subject: [PATCH 18/46] Doc: Documentation for --deploy extension and few extension differences --- docs/basics.rst | 9 +++++++++ news/3914.doc.rst | 1 + 2 files changed, 10 insertions(+) create mode 100644 news/3914.doc.rst diff --git a/docs/basics.rst b/docs/basics.rst index 677a4716..5dc7f204 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -315,6 +315,7 @@ The user can provide these additional parameters: - ``--dev`` — Install both ``develop`` and ``default`` packages from ``Pipfile``. - ``--system`` — Use the system ``pip`` command rather than the one from your virtualenv. + - ``--deploy --system`` — The workflow is using pipenv for package loc in local development environment for having a Pipfile and Pipfile.locl file. Deployment can be done using the command. The ``--deploy`` makes sure the packages are properly locked in Pipfile.lock. - ``--ignore-pipfile`` — Ignore the ``Pipfile`` and install from the ``Pipfile.lock``. - ``--skip-lock`` — Ignore the ``Pipfile.lock`` and install from the ``Pipfile``. In addition, do not write out a ``Pipfile.lock`` reflecting changes to the ``Pipfile``. @@ -404,3 +405,11 @@ production environments for reproducible builds. If you'd like a ``requirements.txt`` output of the lockfile, run ``$ pipenv lock -r``. This will include all hashes, however (which is great!). To get a ``requirements.txt`` without hashes, use ``$ pipenv run pip freeze``. + + +☤ Few notable differences +------------------------- + +- ``pip install pipenv`` is installing pipenv as a tool. +- ``pip install --system`` installs packages in the machine. +- ``pipenv install`` will create virtualenv and install package in it. diff --git a/news/3914.doc.rst b/news/3914.doc.rst new file mode 100644 index 00000000..2cc94a20 --- /dev/null +++ b/news/3914.doc.rst @@ -0,0 +1 @@ +Write description for --deploy extension and few extensions differences. From 02d33f2da3b0d03e5fac09447bf8d8d67069c87f Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Sat, 7 Sep 2019 17:59:45 +0530 Subject: [PATCH 19/46] Doc: Expose issues with fancy extension --- news/3912.doc.rst | 1 + pipenv/cli/command.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 news/3912.doc.rst diff --git a/news/3912.doc.rst b/news/3912.doc.rst new file mode 100644 index 00000000..24598d19 --- /dev/null +++ b/news/3912.doc.rst @@ -0,0 +1 @@ +Added a line describing potential issues in fancy extension. diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 293822a8..9d3ce9bf 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -342,7 +342,8 @@ def lock( "--fancy", is_flag=True, default=False, - help="Run in shell in fancy mode (for elegantly configured shells).", + help="Run in shell in fancy mode. Make sure the shell have no path manipulating" + " scripts. Run $pipenv shell for issues with compatibility mode.", ) @option( "--anyway", From 4b21f5a2898e8360b740086588d48fec8c35fb61 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Sun, 8 Sep 2019 21:53:41 +0530 Subject: [PATCH 20/46] Remove --system --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index 5dc7f204..2bade3c7 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -315,7 +315,7 @@ The user can provide these additional parameters: - ``--dev`` — Install both ``develop`` and ``default`` packages from ``Pipfile``. - ``--system`` — Use the system ``pip`` command rather than the one from your virtualenv. - - ``--deploy --system`` — The workflow is using pipenv for package loc in local development environment for having a Pipfile and Pipfile.locl file. Deployment can be done using the command. The ``--deploy`` makes sure the packages are properly locked in Pipfile.lock. + - ``--deploy`` — The workflow is using pipenv for package loc in local development environment for having a Pipfile and Pipfile.lock. The ``--deploy`` makes sure the packages are properly locked in Pipfile.lock. - ``--ignore-pipfile`` — Ignore the ``Pipfile`` and install from the ``Pipfile.lock``. - ``--skip-lock`` — Ignore the ``Pipfile.lock`` and install from the ``Pipfile``. In addition, do not write out a ``Pipfile.lock`` reflecting changes to the ``Pipfile``. From b90fb1b9ba79c6e9e8c86a61b3da83e7ecee8780 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Sun, 8 Sep 2019 22:07:19 +0530 Subject: [PATCH 21/46] Clearly define python_version format info --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index 008c08a5..7509e556 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -125,7 +125,7 @@ Example Pipfile.lock - Generally, keep both ``Pipfile`` and ``Pipfile.lock`` in version control. - Do not keep ``Pipfile.lock`` in version control if multiple versions of Python are being targeted. -- Specify your target Python version in your `Pipfile`'s ``[requires]`` section. Ideally, you should only have one target Python version, as this is a deployment tool. ``python_version`` can be ``>`` Python 2.7 and ``<`` Python 3.7. +- Specify your target Python version in your `Pipfile`'s ``[requires]`` section. Ideally, you should only have one target Python version, as this is a deployment tool. ``python_version`` should be in the format ``X.Y`` and ``python_full_version`` should be in ``X.Y.Z`` format. - ``pipenv install`` is fully compatible with ``pip install`` syntax, for which the full documentation can be found `here `_. - Note that the ``Pipfile`` uses the `TOML Spec `_. From 1c99bb51707f17b423baf88942b9031e28c74374 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Sun, 8 Sep 2019 22:26:16 +0530 Subject: [PATCH 22/46] Rname file as conflicts --- news/{3912.doc.rst => 3913.doc.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{3912.doc.rst => 3913.doc.rst} (100%) diff --git a/news/3912.doc.rst b/news/3913.doc.rst similarity index 100% rename from news/3912.doc.rst rename to news/3913.doc.rst From a108625ad97f173b472a14562693e52d1fe1d1a0 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Mon, 9 Sep 2019 06:38:00 +0530 Subject: [PATCH 23/46] Remove extension differences text --- docs/basics.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/basics.rst b/docs/basics.rst index 2bade3c7..ab6887cc 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -405,11 +405,3 @@ production environments for reproducible builds. If you'd like a ``requirements.txt`` output of the lockfile, run ``$ pipenv lock -r``. This will include all hashes, however (which is great!). To get a ``requirements.txt`` without hashes, use ``$ pipenv run pip freeze``. - - -☤ Few notable differences -------------------------- - -- ``pip install pipenv`` is installing pipenv as a tool. -- ``pip install --system`` installs packages in the machine. -- ``pipenv install`` will create virtualenv and install package in it. From c558a862040680cb6dd25df08df569d877fbf4cd Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Mon, 9 Sep 2019 06:42:13 +0530 Subject: [PATCH 24/46] define documentation improvement --- news/3913.doc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/3913.doc.rst b/news/3913.doc.rst index 55c13b35..ae37d61d 100644 --- a/news/3913.doc.rst +++ b/news/3913.doc.rst @@ -1 +1 @@ -Define python_version value. +Clarify the proper value of `python_version` and `python_full_version`. From 7a12dbb5cacc71d1dd2d74d8cce8eb50ce2db121 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Tue, 10 Sep 2019 08:51:00 +0530 Subject: [PATCH 25/46] Doc: Write pipefile description (#3937) Doc: Write pipefile description --- docs/basics.rst | 6 ++++++ news/3913.doc.rst | 1 + 2 files changed, 7 insertions(+) create mode 100644 news/3913.doc.rst diff --git a/docs/basics.rst b/docs/basics.rst index 677a4716..9593d0c0 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -10,6 +10,12 @@ This document covers some of Pipenv's more basic features. ☤ Example Pipfile & Pipfile.lock -------------------------------- +Pipfiles contain information for the dependencies of the project, and supercede +the requirements.txt present in Python projects. You should add Pipfile in the +Git repository letting users who clone the repository the only thing required would be +installing Pipenv in the machine and type ``pipenv install``. Pipenv is a reference +implementation for using Pipfile. + .. _example_files: Here is a simple example of a ``Pipfile`` and the resulting ``Pipfile.lock``. diff --git a/news/3913.doc.rst b/news/3913.doc.rst new file mode 100644 index 00000000..54fbbfe8 --- /dev/null +++ b/news/3913.doc.rst @@ -0,0 +1 @@ +Documental description of how Pipfile works and association with Pipenv. From 27026334e46c5e7a0c81eba4cc65e71f6fcf99fa Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Wed, 25 Sep 2019 21:31:00 +0530 Subject: [PATCH 26/46] rename file --- news/{3913.doc.rst => 3914.doc.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{3913.doc.rst => 3914.doc.rst} (100%) diff --git a/news/3913.doc.rst b/news/3914.doc.rst similarity index 100% rename from news/3913.doc.rst rename to news/3914.doc.rst From 823f71fcce4865e3a15ac6510e3f4d4bc5fbd501 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Wed, 25 Sep 2019 21:32:50 +0530 Subject: [PATCH 27/46] address review --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index d7469535..673b7fe9 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -321,7 +321,7 @@ The user can provide these additional parameters: - ``--dev`` — Install both ``develop`` and ``default`` packages from ``Pipfile``. - ``--system`` — Use the system ``pip`` command rather than the one from your virtualenv. - - ``--deploy`` — The workflow is using pipenv for package loc in local development environment for having a Pipfile and Pipfile.lock. The ``--deploy`` makes sure the packages are properly locked in Pipfile.lock. + - ``--deploy`` — The workflow is using pipenv for package loc in local development environment for having a Pipfile and Pipfile.lock. The ``--deploy`` makes sure the packages are properly locked in Pipfile.lock, and abort if the lock file is out-of-date. - ``--ignore-pipfile`` — Ignore the ``Pipfile`` and install from the ``Pipfile.lock``. - ``--skip-lock`` — Ignore the ``Pipfile.lock`` and install from the ``Pipfile``. In addition, do not write out a ``Pipfile.lock`` reflecting changes to the ``Pipfile``. From 87a0d79cf215b40cca34ce079029b26b5a42cf71 Mon Sep 17 00:00:00 2001 From: Ashley Stallings Date: Tue, 1 Oct 2019 07:55:21 -0500 Subject: [PATCH 28/46] Update documentation links to take you to the correct website --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8be2052e..498625e9 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Or, if you\'re using FreeBSD: # pkg install py36-pipenv -Otherwise, refer to the [documentation](https://docs.pipenv.org/en/latest/install/#installing-pipenv) for instructions. +Otherwise, refer to the [documentation](https://pipenv.kennethreitz.org/en/latest/#install-pipenv-today) for instructions. ✨🍰✨ @@ -303,4 +303,4 @@ Use the shell: ☤ Documentation --------------- -Documentation resides over at [pipenv.org](http://pipenv.org/). +Documentation resides over at [pipenv.org](https://pipenv.kennethreitz.org/en/latest/). From 9b6a745758427f5842611c714ffe346be8bfa0ef Mon Sep 17 00:00:00 2001 From: Jon Erling Hustadnes Date: Sat, 5 Oct 2019 15:37:41 +0200 Subject: [PATCH 29/46] Fixed link references for PEP 440 --- docs/basics.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/basics.rst b/docs/basics.rst index 9593d0c0..574bc0bc 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -202,7 +202,7 @@ This will update your ``Pipfile`` to reflect this requirement, automatically. In general, Pipenv uses the same specifier format as pip. However, note that according to `PEP 440`_ , you can't use versions containing a hyphen or a plus sign. -.. _`PEP 440`: +.. _`PEP 440`: https://www.python.org/dev/peps/pep-0440/ To make inclusive or exclusive version comparisons you can use: :: @@ -222,7 +222,7 @@ To avoid installing a specific version you can use the ``!=`` identifier. For an in depth explanation of the valid identifiers and more complex use cases check `the relevant section of PEP-440`_. -.. _`the relevant section of PEP-440`: https://www.python.org/dev/peps/pep-0440/#version-specifiers> +.. _`the relevant section of PEP-440`: https://www.python.org/dev/peps/pep-0440/#version-specifiers ☤ Specifying Versions of Python ------------------------------- From 2521effdecad1f7cb2e3e23c079d6d1f6c84a4f0 Mon Sep 17 00:00:00 2001 From: illgitthat Date: Tue, 15 Oct 2019 10:33:05 -0400 Subject: [PATCH 30/46] Update diagnose URL Related to https://github.com/pypa/pipenv/issues/3958 Going to the old URL https://docs.pipenv.org/en/latest/diagnose/ was giving an SSL error. This can be fixed in two ways 1. Update URL to http://docs.pipenv.org/en/latest/diagnose/ 1. Update URL to https://pipenv.kennethreitz.org/en/latest/diagnose/ I chose the second approach to match the project homepage URL. --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 3dc4613e..30b70bf3 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -5,7 +5,7 @@ about: Create a report to help us improve Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv. -Check the [diagnose documentation](https://docs.pipenv.org/en/latest/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way. +Check the [diagnose documentation](https://pipenv.kennethreitz.org/en/latest/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way. Make sure to mention your debugging experience if the documented solution failed. From 3bd4e893acc93eb8b0905b380be2ba5d71353f31 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Wed, 16 Oct 2019 05:58:33 +0530 Subject: [PATCH 31/46] address review --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index aefad4eb..0b5a11fd 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -321,7 +321,7 @@ The user can provide these additional parameters: - ``--dev`` — Install both ``develop`` and ``default`` packages from ``Pipfile``. - ``--system`` — Use the system ``pip`` command rather than the one from your virtualenv. - - ``--deploy`` — The workflow is using pipenv for package loc in local development environment for having a Pipfile and Pipfile.lock. The ``--deploy`` makes sure the packages are properly locked in Pipfile.lock, and abort if the lock file is out-of-date. + - ``--deploy`` — Make sure the packages are properly locked in Pipfile.lock, and abort if the lock file is out-of-date. - ``--ignore-pipfile`` — Ignore the ``Pipfile`` and install from the ``Pipfile.lock``. - ``--skip-lock`` — Ignore the ``Pipfile.lock`` and install from the ``Pipfile``. In addition, do not write out a ``Pipfile.lock`` reflecting changes to the ``Pipfile``. From 6a20571e67e79c1bfb595f75140d47789e7a9a52 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Wed, 16 Oct 2019 16:54:42 +0530 Subject: [PATCH 32/46] rename file --- news/{3914.doc.rst => 3915.doc.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{3914.doc.rst => 3915.doc.rst} (100%) diff --git a/news/3914.doc.rst b/news/3915.doc.rst similarity index 100% rename from news/3914.doc.rst rename to news/3915.doc.rst From 1fe04c27f7ad5de4575d35039b8a865deef00577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 29 Oct 2019 13:06:27 +0100 Subject: [PATCH 33/46] pipenv is available on all Fedoras Fedora 28 is EOL. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 498625e9..a2c99f26 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Or, if you\'re using Debian Buster+: $ sudo apt install pipenv -Or, if you\'re using Fedora 28: +Or, if you\'re using Fedora: $ sudo dnf install pipenv From 2c343840ff8fdd6a6560336fb5a00724e1b027b9 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 12 Nov 2019 14:42:41 +0100 Subject: [PATCH 34/46] Removing myself again. Not sure what went wrong in https://github.com/pypa/pipenv/pull/3536. --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index a2c99f26..def7281f 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,6 @@ Otherwise, refer to the [documentation](https://pipenv.kennethreitz.org/en/lates ☤ 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 From 14fde9b4ea8fbf16dfed9cd9c2144556c614e95f Mon Sep 17 00:00:00 2001 From: Alfonso Ruzafa Date: Wed, 4 Dec 2019 23:00:30 +0100 Subject: [PATCH 35/46] honor PIPENV_SPINNER environment variable --- news/4045.bugfix.rst | 1 + pipenv/environments.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 news/4045.bugfix.rst diff --git a/news/4045.bugfix.rst b/news/4045.bugfix.rst new file mode 100644 index 00000000..6558018c --- /dev/null +++ b/news/4045.bugfix.rst @@ -0,0 +1 @@ +Honor PIPENV_SPINNER environment variable diff --git a/pipenv/environments.py b/pipenv/environments.py index e59ed63a..763a61a3 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -151,6 +151,7 @@ if PIPENV_IS_CI: PIPENV_NOSPIN = True PIPENV_SPINNER = "dots" if not os.name == "nt" else "bouncingBar" +PIPENV_SPINNER = os.environ.get("PIPENV_SPINNER", PIPENV_SPINNER) """Sets the default spinner type. Spinners are identitcal to the node.js spinners and can be found at From c16f1092fa4715077098c390e6b2f99e9e88993e Mon Sep 17 00:00:00 2001 From: Fridolin Pokorny Date: Mon, 16 Dec 2019 10:58:53 +0100 Subject: [PATCH 36/46] Fix setting os.environ of Python 3.7+ Fixes: #4059 --- pipenv/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index f263ee9f..23d118f9 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -1286,7 +1286,9 @@ def venv_resolve_deps( os.environ["PIPENV_VERBOSITY"] = str(environments.PIPENV_VERBOSITY) os.environ["PIPENV_REQ_DIR"] = fs_str(req_dir) os.environ["PIP_NO_INPUT"] = fs_str("1") - os.environ["PIPENV_SITE_DIR"] = get_pipenv_sitedir() + pipenv_site_dir = get_pipenv_sitedir() + if pipenv_site_dir is not None: + os.environ["PIPENV_SITE_DIR"] = pipenv_site_dir if keep_outdated: os.environ["PIPENV_KEEP_OUTDATED"] = fs_str("1") with create_spinner(text=decode_for_output("Locking...")) as sp: From 5e767e9c5475e214238edc112d2b0623d7550e6d Mon Sep 17 00:00:00 2001 From: Fridolin Pokorny Date: Mon, 13 Jan 2020 04:32:19 +0100 Subject: [PATCH 37/46] Pop PIPENV_SITE_DIR if not set --- pipenv/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipenv/utils.py b/pipenv/utils.py index 23d118f9..32f4491c 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -1289,6 +1289,8 @@ def venv_resolve_deps( pipenv_site_dir = get_pipenv_sitedir() if pipenv_site_dir is not None: os.environ["PIPENV_SITE_DIR"] = pipenv_site_dir + else: + os.environ.pop("PIPENV_SITE_DIR", None) if keep_outdated: os.environ["PIPENV_KEEP_OUTDATED"] = fs_str("1") with create_spinner(text=decode_for_output("Locking...")) as sp: From 7801481598a8e154b62a14f0e2f11e9bc5af8587 Mon Sep 17 00:00:00 2001 From: Elton Viana Date: Mon, 13 Jan 2020 00:54:43 -0500 Subject: [PATCH 38/46] Use listcomp instead of filter with lambda function (#3969) --- pipenv/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/environment.py b/pipenv/environment.py index a1a28bf5..b57a858a 100644 --- a/pipenv/environment.py +++ b/pipenv/environment.py @@ -916,7 +916,7 @@ class Environment(object): pathset_base = pip_shims.UninstallPathSet pathset_base._permitted = PatchedUninstaller._permitted dist = next( - iter(filter(lambda d: d.project_name == pkgname, self.get_working_set())), + iter(d for d in self.get_working_set() if d.project_name == pkgname), None ) pathset = pathset_base.from_dist(dist) From 181c9648a0bc37540ee223e1d949d25923593955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hauke=20L=C3=B6ffler?= Date: Mon, 13 Jan 2020 06:55:28 +0100 Subject: [PATCH 39/46] Create .dockerignore to speedup docker build (#3966) Just ignore all directories to speed up build. --- .dockerignore | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..c9efdaea --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +./examples +./tests +./docs +./news +./pipenv +./.git +./.buildkite +./peeps +./.github +./tasks +./.azure-pipelines From 232e076e26a371f7caeb6785d237a844bec77a74 Mon Sep 17 00:00:00 2001 From: James Stidard Date: Sat, 9 Nov 2019 13:54:52 +0000 Subject: [PATCH 40/46] pyenv and asdf installers --- pipenv/core.py | 40 +++++++++------ pipenv/environments.py | 6 +++ pipenv/{pyenv.py => installers.py} | 82 +++++++++++++++++++++++------- 3 files changed, 94 insertions(+), 34 deletions(-) rename pipenv/{pyenv.py => installers.py} (61%) diff --git a/pipenv/core.py b/pipenv/core.py index 3e299c8d..c30651cf 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -24,9 +24,9 @@ from ._compat import decode_for_output, fix_utf8 from .cmdparse import Script from .environments import ( PIP_EXISTS_ACTION, PIPENV_CACHE_DIR, PIPENV_COLORBLIND, - PIPENV_DEFAULT_PYTHON_VERSION, PIPENV_DONT_USE_PYENV, PIPENV_HIDE_EMOJIS, - PIPENV_MAX_SUBPROCESS, PIPENV_PYUP_API_KEY, PIPENV_RESOLVE_VCS, - PIPENV_SHELL_FANCY, PIPENV_SKIP_VALIDATION, PIPENV_YES, + PIPENV_DEFAULT_PYTHON_VERSION, PIPENV_DONT_USE_PYENV, PIPENV_DONT_USE_ASDF, + PIPENV_HIDE_EMOJIS, PIPENV_MAX_SUBPROCESS, PIPENV_PYUP_API_KEY, + PIPENV_RESOLVE_VCS, PIPENV_SHELL_FANCY, PIPENV_SKIP_VALIDATION, PIPENV_YES, SESSION_IS_INTERACTIVE, is_type_checking ) from .patched import crayons @@ -392,28 +392,36 @@ def ensure_python(three=None, python=None): ), err=True, ) - # Pyenv is installed - from .vendor.pythonfinder.environment import PYENV_INSTALLED + # check for python installers + from .vendor.pythonfinder.environment import PYENV_INSTALLED, ASDF_INSTALLED + from .installers import Pyenv, Asdf, InstallerError - if not PYENV_INSTALLED: + # prefer pyenv if both pyenv and asdf are installed as it's + # dedicated to python installs so probably the preferred + # method of the user for new python installs. + if PYENV_INSTALLED and not PIPENV_DONT_USE_PYENV: + installer = Pyenv("pyenv") + elif ASDF_INSTALLED and not PIPENV_DONT_USE_ASDF: + installer = Asdf("asdf") + else: + installer = None + + if not installer: abort() else: - if (not PIPENV_DONT_USE_PYENV) and (SESSION_IS_INTERACTIVE or PIPENV_YES): - from .pyenv import Runner, PyenvError - - pyenv = Runner("pyenv") + if SESSION_IS_INTERACTIVE or PIPENV_YES: try: - version = pyenv.find_version_to_install(python) + version = installer.find_version_to_install(python) except ValueError: abort() - except PyenvError as e: + except InstallerError as e: click.echo(fix_utf8("Something went wrong…")) click.echo(crayons.blue(e.err), err=True) abort() s = "{0} {1} {2}".format( "Would you like us to install", crayons.green("CPython {0}".format(version)), - "with pyenv?", + "with {0}?".format(installer), ) # Prompt the user to continue… if not (PIPENV_YES or click.confirm(s, default=True)): @@ -424,15 +432,15 @@ def ensure_python(three=None, python=None): u"{0} {1} {2} {3}{4}".format( crayons.normal(u"Installing", bold=True), crayons.green(u"CPython {0}".format(version), bold=True), - crayons.normal(u"with pyenv", bold=True), + crayons.normal(u"with {}".format(installer), bold=True), crayons.normal(u"(this may take a few minutes)"), crayons.normal(fix_utf8("…"), bold=True), ) ) with create_spinner("Installing python...") as sp: try: - c = pyenv.install(version) - except PyenvError as e: + c = installer.install(version) + except InstallerError as e: sp.fail(environments.PIPENV_SPINNER_FAIL_TEXT.format( "Failed...") ) diff --git a/pipenv/environments.py b/pipenv/environments.py index 763a61a3..622b76ff 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -68,6 +68,12 @@ PIPENV_DONT_USE_PYENV = bool(os.environ.get("PIPENV_DONT_USE_PYENV")) Default is to install Python automatically via pyenv when needed, if possible. """ +PIPENV_DONT_USE_ASDF = bool(os.environ.get("PIPENV_DONT_USE_ASDF")) +"""If set, Pipenv does not attempt to install Python with asdf. + +Default is to install Python automatically via asdf when needed, if possible. +""" + PIPENV_DOTENV_LOCATION = os.environ.get("PIPENV_DOTENV_LOCATION") """If set, Pipenv loads the ``.env`` file at the specified location. diff --git a/pipenv/pyenv.py b/pipenv/installers.py similarity index 61% rename from pipenv/pyenv.py rename to pipenv/installers.py index 941e5991..cd8e49a2 100644 --- a/pipenv/pyenv.py +++ b/pipenv/installers.py @@ -48,19 +48,22 @@ class Version(object): return (self.major, self.minor) == (other.major, other.minor) -class PyenvError(RuntimeError): +class InstallerError(RuntimeError): def __init__(self, desc, c): - super(PyenvError, self).__init__(desc) + super(InstallerError, self).__init__(desc) self.out = c.out self.err = c.err -class Runner(object): +class Installer(object): - def __init__(self, pyenv): - self._cmd = pyenv + def __init__(self, cmd): + self._cmd = cmd - def _pyenv(self, *args, **kwargs): + def __str__(self): + return self._cmd + + def _run(self, *args, **kwargs): timeout = kwargs.pop('timeout', delegator.TIMEOUT) if kwargs: k = list(kwargs.keys())[0] @@ -69,21 +72,16 @@ class Runner(object): c = delegator.run(args, block=False, timeout=timeout) c.block() if c.return_code != 0: - raise PyenvError('faild to run {0}'.format(args), c) + raise InstallerError('faild to run {0}'.format(args), c) return c def iter_installable_versions(self): """Iterate through CPython versions available for Pipenv to install. """ - for name in self._pyenv('install', '--list').out.splitlines(): - try: - version = Version.parse(name.strip()) - except ValueError: - continue - yield version + raise NotImplementedError def find_version_to_install(self, name): - """Find a version in pyenv from the version supplied. + """Find a version in the installer from the version supplied. A ValueError is raised if a matching version cannot be found. """ @@ -103,16 +101,64 @@ class Runner(object): return best_match def install(self, version): - """Install the given version with pyenv. + """Install the given version with runner implementation. The version must be a ``Version`` instance representing a version - found in pyenv. + found in the Installer. A ValueError is raised if the given version does not have a match in - pyenv. A PyenvError is raised if the pyenv command fails. + the runner. A InstallerError is raised if the runner command fails. """ - c = self._pyenv( + raise NotImplementedError + + +class Pyenv(Installer): + + def iter_installable_versions(self): + """Iterate through CPython versions available for Pipenv to install. + """ + for name in self._run('install', '--list').out.splitlines(): + try: + version = Version.parse(name.strip()) + except ValueError: + continue + yield version + + def install(self, version): + """Install the given version with pyenv. + The version must be a ``Version`` instance representing a version + found in pyenv. + A ValueError is raised if the given version does not have a match in + pyenv. A InstallerError is raised if the pyenv command fails. + """ + c = self._run( 'install', '-s', str(version), timeout=PIPENV_INSTALL_TIMEOUT, ) return c + + +class Asdf(Installer): + + def iter_installable_versions(self): + """Iterate through CPython versions available for asdf to install. + """ + for name in self._run('list-all', 'python').out.splitlines(): + try: + version = Version.parse(name.strip()) + except ValueError: + continue + yield version + + def install(self, version): + """Install the given version with asdf. + The version must be a ``Version`` instance representing a version + found in asdf. + A ValueError is raised if the given version does not have a match in + asdf. A InstallerError is raised if the asdf command fails. + """ + c = self._run( + 'install', 'python', str(version), + timeout=PIPENV_INSTALL_TIMEOUT, + ) + return c From a921dfa99b9fc853bff49f30741efd1b372a3ed9 Mon Sep 17 00:00:00 2001 From: James Stidard Date: Sat, 9 Nov 2019 14:11:28 +0000 Subject: [PATCH 41/46] added feature fragment --- news/4018.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/4018.feature.rst diff --git a/news/4018.feature.rst b/news/4018.feature.rst new file mode 100644 index 00000000..fcd6a2a9 --- /dev/null +++ b/news/4018.feature.rst @@ -0,0 +1 @@ +Added support for automatic python installs via ``asdf`` and associated ``PIPENV_DONT_USE_ASDF`` environment variable. From d10b2a216a25623ba9b3e3c4ce4573e0d764c1e4 Mon Sep 17 00:00:00 2001 From: James Stidard Date: Sat, 9 Nov 2019 14:17:53 +0000 Subject: [PATCH 42/46] consistent foramt string usage --- pipenv/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index c30651cf..74b72359 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -432,7 +432,7 @@ def ensure_python(three=None, python=None): u"{0} {1} {2} {3}{4}".format( crayons.normal(u"Installing", bold=True), crayons.green(u"CPython {0}".format(version), bold=True), - crayons.normal(u"with {}".format(installer), bold=True), + crayons.normal(u"with {0}".format(installer), bold=True), crayons.normal(u"(this may take a few minutes)"), crayons.normal(fix_utf8("…"), bold=True), ) From 1fcb1b5bc195922602ef77a6e3fba2cb5c1c08c7 Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Wed, 15 Jan 2020 10:40:01 +0000 Subject: [PATCH 43/46] [docs] mention variable expansion in `.env` files fix #3610 --- docs/advanced.rst | 17 +++++++++++++++++ news/4100.doc.rst | 1 + 2 files changed, 18 insertions(+) create mode 100644 news/4100.doc.rst diff --git a/docs/advanced.rst b/docs/advanced.rst index 9efb798e..014bd62d 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -344,6 +344,21 @@ If a ``.env`` file is present in your project, ``$ pipenv shell`` and ``$ pipenv >>> os.environ['HELLO'] 'WORLD' +Shell like variable expansion is available in ``.env`` files using `${VARNAME}` syntax.:: + + $ cat .env + CONFIG_PATH=${HOME}/.config/foo + + $ pipenv run python + Loading .env environment variables… + Python 3.7.6 (default, Dec 19 2019, 22:52:49) + [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux + Type "help", "copyright", "credits" or "license" for more information. + >>> import os + >>> os.environ['CONFIG_PATH'] + '/home/kennethreitz/.config/foo' + + This is very useful for keeping production credentials out of your codebase. We do not recommend committing ``.env`` files into source control! @@ -355,6 +370,8 @@ To prevent pipenv from loading the ``.env`` file, set the ``PIPENV_DONT_LOAD_ENV $ PIPENV_DONT_LOAD_ENV=1 pipenv shell +See `theskumar/python-dotenv `_ for more information on ``.env`` files. + ☤ Custom Script Shortcuts ------------------------- diff --git a/news/4100.doc.rst b/news/4100.doc.rst new file mode 100644 index 00000000..050bdcca --- /dev/null +++ b/news/4100.doc.rst @@ -0,0 +1 @@ +More documentation for ``.env`` files From 603a20bf453cfe798286316467d073799f3a157e Mon Sep 17 00:00:00 2001 From: Sumana Harihareswara Date: Thu, 5 Mar 2020 20:48:40 -0500 Subject: [PATCH 44/46] Update links in documentation The canonical Pipenv documentation is now at pipenv.pypa.io. Also, the canonical GitHub repositories for Pipenv and Requests have changed, and some other communications links (Twitter, mailing list, "thank you") were no longer operational. This commit updates those and clarifies that Pipenv is a project maintained by the PyPA. Fixes #4137. Signed-off-by: Sumana Harihareswara --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- .gitmodules | 4 ++-- LICENSE | 2 +- README.md | 5 ++--- docs/_templates/sidebarintro.html | 7 +++---- docs/_templates/sidebarlogo.html | 13 ++++++------- docs/advanced.rst | 4 ++-- docs/conf.py | 4 ++-- docs/dev/philosophy.rst | 2 ++ docs/index.rst | 3 --- docs/install.rst | 2 +- news/4137.doc | 1 + pipenv/pipenv.1 | 4 ++-- setup.py | 4 ++-- tests/integration/test_lock.py | 16 ++++++++-------- tests/unit/test_utils.py | 4 ++-- 16 files changed, 37 insertions(+), 40 deletions(-) create mode 100644 news/4137.doc diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 30b70bf3..e516787f 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -5,7 +5,7 @@ about: Create a report to help us improve Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv. -Check the [diagnose documentation](https://pipenv.kennethreitz.org/en/latest/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way. +Check the [diagnose documentation](https://pipenv.pypa.io/en/latest/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way. Make sure to mention your debugging experience if the documented solution failed. diff --git a/.gitmodules b/.gitmodules index e2f779af..4f0f9fa2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = https://github.com/pinax/pinax.git [submodule "tests/test_artifacts/git/requests"] path = tests/test_artifacts/git/requests - url = https://github.com/kennethreitz/requests.git + url = https://github.com/psf/requests.git [submodule "tests/test_artifacts/git/six"] path = tests/test_artifacts/git/six url = https://github.com/benjaminp/six.git @@ -24,7 +24,7 @@ url = https://github.com/pallets/flask.git [submodule "tests/test_artifacts/git/requests-2.18.4"] path = tests/test_artifacts/git/requests-2.18.4 - url = https://github.com/kennethreitz/requests + url = https://github.com/psf/requests [submodule "tests/pypi"] path = tests/pypi url = https://github.com/sarugaku/pipenv-test-artifacts.git diff --git a/LICENSE b/LICENSE index f5639bb0..ea28562e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright 2017 Kenneth Reitz +Copyright 2020 Python Packaging Authority Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index def7281f..a8f251db 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Pipenv: Python Development Workflow for Humans [![image](https://img.shields.io/pypi/l/pipenv.svg)](https://python.org/pypi/pipenv) [![Azure Pipelines Build Status](https://dev.azure.com/pypa/pipenv/_apis/build/status/Pipenv%20CI?branchName=master)](https://dev.azure.com/pypa/pipenv/_build/latest?definitionId=16&branchName=master) [![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) ------------------------------------------------------------------------ @@ -56,7 +55,7 @@ Or, if you\'re using FreeBSD: # pkg install py36-pipenv -Otherwise, refer to the [documentation](https://pipenv.kennethreitz.org/en/latest/#install-pipenv-today) for instructions. +Otherwise, refer to the [documentation](https://pipenv.pypa.io/en/latest/#install-pipenv-today) for instructions. ✨🍰✨ @@ -297,4 +296,4 @@ Use the shell: ☤ Documentation --------------- -Documentation resides over at [pipenv.org](https://pipenv.kennethreitz.org/en/latest/). +Documentation resides over at [pipenv.pypa.io](https://pipenv.pypa.io/en/latest/). diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 67c83d0e..cbf7e5f8 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -37,9 +37,8 @@

    Stay Informed

    Receive updates on new releases and upcoming projects.

    -

    -

    Say Thanks!

    -

    Join Mailing List.

    +

    +

    Join Mailing List.

    Other Projects

    @@ -47,7 +46,7 @@
  • Pipenv-Pipes
  • -

    More Kenneth Reitz projects:

    +

    More projects founded by Kenneth Reitz:

    • pep8.org
    • httpbin.org
    • diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index d574633f..59e8641e 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -38,12 +38,11 @@

      Stay Informed

      Receive updates on new releases and upcoming projects.

      -

      -

      -

      Say Thanks!

      -

      Join Mailing List.

      +

      +

      Join Mailing List.

      Other Projects

      @@ -51,7 +50,7 @@
    • Pipenv-Pipes
    -

    More Kenneth Reitz projects:

    +

    More projects founded by Kenneth Reitz:

    • pep8.org
    • httpbin.org
    • @@ -72,9 +71,9 @@

    • Pipenv @ GitHub
    • -
    • Pipenv @ PyPI
    • +
    • Pipenv @ PyPI
    • Pipenv PPA (PyPA)
    • -
    • Issue Tracker
    • +
    • Issue Tracker

    • 日本語
    • Español
    • diff --git a/docs/advanced.rst b/docs/advanced.rst index 9efb798e..f410006b 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -20,7 +20,7 @@ This document covers some of Pipenv's more glorious and advanced features. If you'd like a specific package to be installed with a specific package index, you can do the following:: [[source]] - url = "https://pypi.python.org/simple" + url = "https://pypi.org/simple" verify_ssl = true name = "pypi" @@ -525,7 +525,7 @@ probably a good idea in any case. A 3rd party plugin, `tox-pipenv`_ is also available to use Pipenv natively with tox. -.. _Requests: https://github.com/kennethreitz/requests +.. _Requests: https://github.com/psf/requests .. _tox: https://tox.readthedocs.io/en/latest/ .. _tox-pipenv: https://tox-pipenv.readthedocs.io/en/latest/ .. _Travis-CI: https://travis-ci.org/ diff --git a/docs/conf.py b/docs/conf.py index c5d6fbe0..90e16afe 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,8 +57,8 @@ master_doc = 'index' # General information about the project. project = u'pipenv' -copyright = u'2017. A Kenneth Reitz Project' -author = u'Kenneth Reitz' +copyright = u'2020. A project founded by Kenneth Reitz' +author = u'Python Packaging Authority' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/dev/philosophy.rst b/docs/dev/philosophy.rst index 9d364e84..3f4c0bd0 100644 --- a/docs/dev/philosophy.rst +++ b/docs/dev/philosophy.rst @@ -7,6 +7,8 @@ Pipenv is an open but opinionated tool, created by an open but opinionated devel Management Style ~~~~~~~~~~~~~~~~ + **To be updated (as of March 2020)**. + `Kenneth Reitz `__ is the BDFL. He has final say in any decision related to the Pipenv project. Kenneth is responsible for the direction and form of the library, as well as its presentation. In addition to making decisions based on technical merit, he is responsible for making decisions based on the development philosophy of Pipenv. `Dan Ryan `__, `Tzu-ping Chung `__, and `Nate Prewitt `__ are the core contributors. diff --git a/docs/index.rst b/docs/index.rst index 6246d1a5..26bfde19 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,9 +15,6 @@ Pipenv: Python Dev Workflow for Humans .. image:: https://img.shields.io/pypi/pyversions/pipenv.svg :target: https://pypi.python.org/pypi/pipenv -.. image:: https://img.shields.io/badge/Say%20Thanks!-🦉-1EAEDB.svg - :target: https://saythanks.io/to/kennethreitz - --------------- **Pipenv** is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a first-class citizen, in our world.* diff --git a/docs/install.rst b/docs/install.rst index b5acd312..6aceba0c 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -146,7 +146,7 @@ To upgrade pipenv at any time:: If you don't even have pip installed, you can use this crude installation method, which will bootstrap your whole system:: - $ curl https://raw.githubusercontent.com/kennethreitz/pipenv/master/get-pipenv.py | python + $ curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python ☤ Installing packages for your project diff --git a/news/4137.doc b/news/4137.doc new file mode 100644 index 00000000..45de74d2 --- /dev/null +++ b/news/4137.doc @@ -0,0 +1 @@ +Updated documentation to point to working links. \ No newline at end of file diff --git a/pipenv/pipenv.1 b/pipenv/pipenv.1 index 6cd64a4c..7dd63f58 100644 --- a/pipenv/pipenv.1 +++ b/pipenv/pipenv.1 @@ -275,7 +275,7 @@ If you don\(aqt even have pip installed, you can use this crude installation met .sp .nf .ft C -$ curl https://raw.githubusercontent.com/kennethreitz/pipenv/master/get\-pipenv.py | python +$ curl https://raw.githubusercontent.com/pypa/pipenv/master/get\-pipenv.py | python .ft P .fi .UNINDENT @@ -4121,6 +4121,6 @@ search .SH AUTHOR Kenneth Reitz .SH COPYRIGHT -2017. A Kenneth Reitz Project +2017. A project founded by Kenneth Reitz .\" Generated by docutils manpage writer. . diff --git a/setup.py b/setup.py index dd8d4f71..c3ee913b 100644 --- a/setup.py +++ b/setup.py @@ -118,8 +118,8 @@ setup( description="Python Development Workflow for Humans.", long_description=long_description, long_description_content_type='text/markdown', - author="Kenneth Reitz", - author_email="me@kennethreitz.org", + author="Pipenv maintainer team", + author_email="distutils-sig@python.org", url="https://github.com/pypa/pipenv", packages=find_packages(exclude=["tests", "tests.*", "tasks", "tasks.*"]), entry_points={ diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index 5c6af0fa..dc6e6526 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -174,7 +174,7 @@ def test_complex_lock_with_vcs_deps(PipenvInstance, pip_src_dir): click = "==6.7" [dev-packages] -requests = {git = "https://github.com/kennethreitz/requests.git"} +requests = {git = "https://github.com/psf/requests.git"} """.strip() f.write(contents) @@ -429,7 +429,7 @@ def test_lock_editable_vcs_without_install(PipenvInstance): with open(p.pipfile_path, 'w') as f: f.write(""" [packages] -requests = {git = "https://github.com/kennethreitz/requests.git", ref = "master", editable = true} +requests = {git = "https://github.com/psf/requests.git", ref = "master", editable = true} """.strip()) c = p.pipenv('lock') assert c.return_code == 0 @@ -448,11 +448,11 @@ def test_lock_editable_vcs_with_ref_in_git(PipenvInstance): with open(p.pipfile_path, 'w') as f: f.write(""" [packages] -requests = {git = "https://github.com/kennethreitz/requests.git@883caaf", editable = true} +requests = {git = "https://github.com/psf/requests.git@883caaf", editable = true} """.strip()) c = p.pipenv('lock') assert c.return_code == 0 - assert p.lockfile['default']['requests']['git'] == 'https://github.com/kennethreitz/requests.git' + assert p.lockfile['default']['requests']['git'] == 'https://github.com/psf/requests.git' assert p.lockfile['default']['requests']['ref'] == '883caaf145fbe93bd0d208a6b864de9146087312' c = p.pipenv('install') assert c.return_code == 0 @@ -466,11 +466,11 @@ def test_lock_editable_vcs_with_ref(PipenvInstance): with open(p.pipfile_path, 'w') as f: f.write(""" [packages] -requests = {git = "https://github.com/kennethreitz/requests.git", ref = "883caaf", editable = true} +requests = {git = "https://github.com/psf/requests.git", ref = "883caaf", editable = true} """.strip()) c = p.pipenv('lock') assert c.return_code == 0 - assert p.lockfile['default']['requests']['git'] == 'https://github.com/kennethreitz/requests.git' + assert p.lockfile['default']['requests']['git'] == 'https://github.com/psf/requests.git' assert p.lockfile['default']['requests']['ref'] == '883caaf145fbe93bd0d208a6b864de9146087312' c = p.pipenv('install') assert c.return_code == 0 @@ -485,7 +485,7 @@ def test_lock_editable_vcs_with_extras_without_install(PipenvInstance): with open(p.pipfile_path, 'w') as f: f.write(""" [packages] -requests = {git = "https://github.com/kennethreitz/requests.git", editable = true, extras = ["socks"]} +requests = {git = "https://github.com/psf/requests.git", editable = true, extras = ["socks"]} """.strip()) c = p.pipenv('lock') assert c.return_code == 0 @@ -505,7 +505,7 @@ def test_lock_editable_vcs_with_markers_without_install(PipenvInstance): with open(p.pipfile_path, 'w') as f: f.write(""" [packages] -requests = {git = "https://github.com/kennethreitz/requests.git", ref = "master", editable = true, markers = "python_version >= '2.6'"} +requests = {git = "https://github.com/psf/requests.git", ref = "master", editable = true, markers = "python_version >= '2.6'"} """.strip()) c = p.pipenv('lock') assert c.return_code == 0 diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index f3a567da..d3363037 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -217,14 +217,14 @@ class TestUtils: @pytest.mark.utils def test_is_valid_url(self): - url = "https://github.com/kennethreitz/requests.git" + url = "https://github.com/psf/requests.git" not_url = "something_else" assert pipenv.utils.is_valid_url(url) assert pipenv.utils.is_valid_url(not_url) is False @pytest.mark.utils def test_download_file(self): - url = "https://github.com/kennethreitz/pipenv/blob/master/README.md" + url = "https://github.com/pypa/pipenv/blob/master/README.md" output = "test_download.md" pipenv.utils.download_file(url, output) assert os.path.exists(output) From 805f438108e740f552e5e28fe746c60557c98214 Mon Sep 17 00:00:00 2001 From: Sumana Harihareswara Date: Fri, 6 Mar 2020 15:51:31 -0500 Subject: [PATCH 45/46] Fix spelling in comment Signed-off-by: Sumana Harihareswara --- tests/integration/test_lock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index dc6e6526..7d207cca 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -15,7 +15,7 @@ from pipenv.utils import temp_environ @pytest.mark.lock @pytest.mark.requirements def test_lock_handle_eggs(PipenvInstance): - """Ensure locking works with packages provoding egg formats. + """Ensure locking works with packages providing egg formats. """ with PipenvInstance() as p: with open(p.pipfile_path, 'w') as f: From d74e7aa310b4b719dc3493f3b2c1ea4a7fd1ac12 Mon Sep 17 00:00:00 2001 From: Sumana Harihareswara Date: Tue, 24 Mar 2020 13:19:23 -0400 Subject: [PATCH 46/46] Update GitHub logo link in docs Signed-off-by: Sumana Harihareswara --- docs/_templates/hacks.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_templates/hacks.html b/docs/_templates/hacks.html index 9736d409..fa7d60ed 100644 --- a/docs/_templates/hacks.html +++ b/docs/_templates/hacks.html @@ -59,7 +59,7 @@ - +