From 543dd1a6fe194bcf9dee16c23df280c97479f507 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sat, 17 Dec 2022 14:07:48 -0500 Subject: [PATCH 01/10] Deprecate --keep-outdated flag. --- pipenv/cli/options.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pipenv/cli/options.py b/pipenv/cli/options.py index 928c64de..50401653 100644 --- a/pipenv/cli/options.py +++ b/pipenv/cli/options.py @@ -13,6 +13,7 @@ from pipenv.vendor.click import ( option, secho, ) +from pipenv.vendor import click from pipenv.vendor.click import types as click_types from pipenv.vendor.click_didyoumean import DYMMixin @@ -156,6 +157,12 @@ def keep_outdated_option(f): def callback(ctx, param, value): state = ctx.ensure_object(State) state.installstate.keep_outdated = value + if value: + click.echo(click.style( + "Use of --keep-outdated has been deprecated for removal." + "The flag does not respect package resolver results and leads to inconsistent lock files. " + "Please pin relevant requirements in your Pipfile and discontinue use of this flag.", + fg="yellow", bold=True), err=True) return value return option( From 700a135ab5bfb69f93c889e376775120bf602467 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 19 Dec 2022 04:16:54 -0500 Subject: [PATCH 02/10] Fix Readme.md links. --- README.md | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index b3705f45..3b8c8fa6 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,7 @@ Table Of Contents - [Installation](#installation) -- [User Testimonals](#☤-user-testimonials) - -- [Features](#☤-features) +- [Features](#features) - [Basic Concepts](#basic-concepts) @@ -54,7 +52,7 @@ Table Of Contents - [Shell Completion](#shell-completion) -- [Usage](#☤-usage) +- [Usage](#usage) - [Usage Examples](#usage-examples) @@ -82,7 +80,7 @@ Table Of Contents - [Use the shell](#use-the-shell) -- [Documentation](#☤-documentation) +- [Documentation](#documentation) Installation ------------ @@ -121,23 +119,7 @@ Otherwise, refer to the [documentation](https://pipenv.pypa.io/en/latest/#instal ✨🍰✨ -☤ User Testimonials -------------------- - -**David Gang**--- - -: *This package manager is really awesome. For the first time I know - exactly what my dependencies are which I installed and what the - transitive dependencies are. Combined with the fact that installs - are deterministic, makes this package manager first class, like - cargo*. - -**Justin Myles Holmes**--- - -: *Pipenv is finally an abstraction meant to engage the mind instead - of merely the filesystem.* - -☤ Features +Features ---------- - Enables truly *deterministic builds*, while easily specifying *only @@ -195,7 +177,7 @@ Alternatively, with bash, add this to your configuration `~/.bashrc` or `~/.bash Magic shell completions are now enabled! -☤ Usage +Usage ------- $ pipenv --help @@ -372,7 +354,7 @@ You can read more about [pip's implementation of vcs support here](https://pip.p Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return. $ ▯ -☤ Documentation +Documentation --------------- Documentation resides over at [pipenv.pypa.io](https://pipenv.pypa.io/en/latest/). From 010bfd7428943bace928558ae88087b2e2dca052 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 19 Dec 2022 04:33:54 -0500 Subject: [PATCH 03/10] vendor in new version of requirementslib. --- pipenv/vendor/requirementslib/__init__.py | 2 +- pipenv/vendor/requirementslib/models/setup_info.py | 5 ++--- pipenv/vendor/vendor.txt | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pipenv/vendor/requirementslib/__init__.py b/pipenv/vendor/requirementslib/__init__.py index 7af3391b..be1bab46 100644 --- a/pipenv/vendor/requirementslib/__init__.py +++ b/pipenv/vendor/requirementslib/__init__.py @@ -5,7 +5,7 @@ from .models.lockfile import Lockfile from .models.pipfile import Pipfile from .models.requirements import Requirement -__version__ = "2.2.1" +__version__ = "2.2.2" logger = logging.getLogger(__name__) diff --git a/pipenv/vendor/requirementslib/models/setup_info.py b/pipenv/vendor/requirementslib/models/setup_info.py index 71b97958..d76b4efe 100644 --- a/pipenv/vendor/requirementslib/models/setup_info.py +++ b/pipenv/vendor/requirementslib/models/setup_info.py @@ -94,8 +94,7 @@ def pep517_subprocess_runner(cmd, cwd=None, extra_environ=None): if extra_environ: env.update(extra_environ) - cmd_as_str = " ".join(cmd) - sp.run(cmd_as_str, cwd=cwd, env=env, stdout=sp.PIPE, stderr=sp.STDOUT, shell=True) + sp.run(cmd, cwd=cwd, env=env, stdout=sp.PIPE, stderr=sp.STDOUT) class BuildEnv(envbuild.BuildEnvironment): @@ -110,7 +109,7 @@ class BuildEnv(envbuild.BuildEnvironment): self.path, ] + list(reqs) - sp.run(cmd, shell=True, stderr=sp.PIPE, stdout=sp.PIPE) + sp.run(cmd, stderr=sp.PIPE, stdout=sp.PIPE) class HookCaller(wrappers.Pep517HookCaller): diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index 37494fad..5a879a0e 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -12,7 +12,7 @@ ptyprocess==0.7.0 pyparsing==3.0.9 python-dotenv==0.19.0 pythonfinder==1.3.1 -requirementslib==2.2.1 +requirementslib==2.2.2 ruamel.yaml==0.17.21 shellingham==1.5.0 toml==0.10.2 From fdc05c2ba72038171a94c2ccc2b8cca7cdfc0d97 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 19 Dec 2022 04:34:44 -0500 Subject: [PATCH 04/10] add news fragment. --- news/5546.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/5546.bugfix.rst diff --git a/news/5546.bugfix.rst b/news/5546.bugfix.rst new file mode 100644 index 00000000..69af727c --- /dev/null +++ b/news/5546.bugfix.rst @@ -0,0 +1 @@ +Fix for ``requirementslib`` hanging during install of remote wheels files. From ea5a0becacad4a20dd6308f7194231cb44403d0f Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 19 Dec 2022 05:23:51 -0500 Subject: [PATCH 05/10] Release v2022.12.19 --- CHANGELOG.rst | 12 ++++++++++++ news/5546.bugfix.rst | 1 - pipenv/__version__.py | 2 +- pipenv/pipenv.1 | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 news/5546.bugfix.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ba9d2967..8daa1130 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,15 @@ +2022.12.19 (2022-12-19) +======================= +Pipenv 2022.12.19 (2022-12-19) +============================== + + +Bug Fixes +--------- + +- Fix for ``requirementslib`` hanging during install of remote wheels files. `#5546 `_ + + 2022.12.17 (2022-12-17) ======================= Pipenv 2022.12.17 (2022-12-17) diff --git a/news/5546.bugfix.rst b/news/5546.bugfix.rst deleted file mode 100644 index 69af727c..00000000 --- a/news/5546.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix for ``requirementslib`` hanging during install of remote wheels files. diff --git a/pipenv/__version__.py b/pipenv/__version__.py index 33e21700..9ba0dbb1 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -2,4 +2,4 @@ # // ) ) / / // ) ) //___) ) // ) ) || / / # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = "2022.12.18.dev0" +__version__ = "2022.12.19" diff --git a/pipenv/pipenv.1 b/pipenv/pipenv.1 index 26eabddf..17611d57 100644 --- a/pipenv/pipenv.1 +++ b/pipenv/pipenv.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "PIPENV" "1" "Dec 17, 2022" "2022.12.17" "pipenv" +.TH "PIPENV" "1" "Dec 19, 2022" "2022.12.19" "pipenv" .sp Pipenv uses a set of commands to manage your Project\(aqs dependencies and custom scripts. It replaces the use of \fBMakefile\fP, direct calls to \fBpip\fP and \fBpython \-m venv\fP or \fBvirtualenv\fP\&. From 2cc44e0c0f56df82827599f9165ed0f5538049bc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 19 Dec 2022 10:26:03 +0000 Subject: [PATCH 06/10] Bumped version. Signed-off-by: github-actions[bot] --- pipenv/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/__version__.py b/pipenv/__version__.py index 9ba0dbb1..f7f4d57c 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -2,4 +2,4 @@ # // ) ) / / // ) ) //___) ) // ) ) || / / # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = "2022.12.19" +__version__ = "2022.12.20.dev0" From 3c4a67a86a5572c5e05862c07923b24391181d33 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 19 Dec 2022 10:33:24 -0500 Subject: [PATCH 07/10] fix lint --- pipenv/cli/options.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pipenv/cli/options.py b/pipenv/cli/options.py index 50401653..d1bdc808 100644 --- a/pipenv/cli/options.py +++ b/pipenv/cli/options.py @@ -2,6 +2,7 @@ import os from pipenv.project import Project from pipenv.utils.internet import is_valid_url +from pipenv.vendor import click from pipenv.vendor.click import ( BadArgumentUsage, BadParameter, @@ -13,7 +14,6 @@ from pipenv.vendor.click import ( option, secho, ) -from pipenv.vendor import click from pipenv.vendor.click import types as click_types from pipenv.vendor.click_didyoumean import DYMMixin @@ -158,11 +158,16 @@ def keep_outdated_option(f): state = ctx.ensure_object(State) state.installstate.keep_outdated = value if value: - click.echo(click.style( - "Use of --keep-outdated has been deprecated for removal." - "The flag does not respect package resolver results and leads to inconsistent lock files. " - "Please pin relevant requirements in your Pipfile and discontinue use of this flag.", - fg="yellow", bold=True), err=True) + click.echo( + click.style( + "Use of --keep-outdated has been deprecated for removal." + "The flag does not respect package resolver results and leads to inconsistent lock files. " + "Please pin relevant requirements in your Pipfile and discontinue use of this flag.", + fg="yellow", + bold=True, + ), + err=True, + ) return value return option( From 3ab2f73d4b8f3b1155e2a4ee69fa44a02223281c Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Tue, 20 Dec 2022 02:20:49 -0500 Subject: [PATCH 08/10] PR feedback. --- pipenv/cli/options.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pipenv/cli/options.py b/pipenv/cli/options.py index d1bdc808..55aed0c1 100644 --- a/pipenv/cli/options.py +++ b/pipenv/cli/options.py @@ -158,14 +158,12 @@ def keep_outdated_option(f): state = ctx.ensure_object(State) state.installstate.keep_outdated = value if value: - click.echo( - click.style( - "Use of --keep-outdated has been deprecated for removal." - "The flag does not respect package resolver results and leads to inconsistent lock files. " - "Please pin relevant requirements in your Pipfile and discontinue use of this flag.", - fg="yellow", - bold=True, - ), + click.secho( + "The flag --keep-outdated has been deprecated for removal." + "The flag does not respect package resolver results and leads to inconsistent lock files. " + "Please pin relevant requirements in your Pipfile and discontinue use of this flag.", + fg="yellow", + bold=True, err=True, ) return value From 68bc35109e4ee6119531381d2f020ccdd9ea5dca Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Fri, 23 Dec 2022 03:13:00 -0500 Subject: [PATCH 09/10] Catch StopIteration error and alert user and exit failure. --- pipenv/core.py | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index 00ed14e5..adabfa24 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -750,20 +750,25 @@ def batch_install( deps_by_index[project.sources_default["name"]].append(dependency) # Treat each index as its own pip install phase for index_name, dependencies in deps_by_index.items(): - install_source = next(filter(lambda s: s["name"] == index_name, sources)) - batch_install_iteration( - project, - dependencies, - [install_source], - procs, - failed_deps_queue, - requirements_dir, - no_deps=no_deps, - ignore_hashes=ignore_hashes, - allow_global=allow_global, - retry=retry, - extra_pip_args=extra_pip_args, - ) + try: + install_source = next(filter(lambda s: s["name"] == index_name, sources)) + batch_install_iteration( + project, + dependencies, + [install_source], + procs, + failed_deps_queue, + requirements_dir, + no_deps=no_deps, + ignore_hashes=ignore_hashes, + allow_global=allow_global, + retry=retry, + extra_pip_args=extra_pip_args, + ) + except StopIteration: + click.secho(f"Unable to find {index_name} in sources, please check dependencies: {dependencies}", + fg="red", bold=True) + sys.exit(1) def batch_install_iteration( From f385606b9983422bbfb4431311a5f839a0a84cc2 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Fri, 23 Dec 2022 04:29:48 -0500 Subject: [PATCH 10/10] Fix lint. --- pipenv/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index adabfa24..e42f184d 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -766,8 +766,11 @@ def batch_install( extra_pip_args=extra_pip_args, ) except StopIteration: - click.secho(f"Unable to find {index_name} in sources, please check dependencies: {dependencies}", - fg="red", bold=True) + click.secho( + f"Unable to find {index_name} in sources, please check dependencies: {dependencies}", + fg="red", + bold=True, + ) sys.exit(1)