From 13c13ed781646093dde50e3fba570a2e4af7bae7 Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Thu, 9 Jan 2025 23:36:00 +0100 Subject: [PATCH 1/2] fix: correct printing of errors Instead of printing err (which is a handle to rich formatter) we print errors - which are the real output of the failed command. Signed-off-by: Oz Tiram --- pipenv/utils/resolver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py index 7de6a7f77..2148a9a8f 100644 --- a/pipenv/utils/resolver.py +++ b/pipenv/utils/resolver.py @@ -767,7 +767,7 @@ def resolve(cmd, st, project): st.console.print(environments.PIPENV_SPINNER_FAIL_TEXT.format("Locking Failed!")) err.print(out.strip()) if not is_verbose: - err.print(err) + err.print(errors) raise RuntimeError("Failed to lock Pipfile.lock!") if is_verbose: err.print(out.strip()) From 69d23318d8c89e0a29ef3a412a213c67c0567bc4 Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Tue, 14 Jan 2025 22:40:22 +0100 Subject: [PATCH 2/2] fix: disable printing resolver verbose The resolver does not have any output, and it just printed a weired "False" which was hard to grasp. Signed-off-by: Oz Tiram --- pipenv/resolver.py | 1 - pipenv/utils/resolver.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pipenv/resolver.py b/pipenv/resolver.py index 0236bd195..28c45d1da 100644 --- a/pipenv/resolver.py +++ b/pipenv/resolver.py @@ -447,7 +447,6 @@ def main(argv=None): os.environ["PYTHONUNBUFFERED"] = "1" parsed = handle_parsed_args(parsed) if not parsed.verbose: - print(parsed.verbose) logging.getLogger("pipenv").setLevel(logging.WARN) _main( parsed.pre, diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py index 2148a9a8f..be5fce455 100644 --- a/pipenv/utils/resolver.py +++ b/pipenv/utils/resolver.py @@ -457,7 +457,7 @@ def resolve(self): try: results = resolver.resolve(self.constraints, check_supported_wheels=False) except InstallationError as e: - raise ResolutionFailure(message=str(e)) + raise ResolutionFailure(message=e) else: self.results = set(results.all_requirements) self.resolved_tree.update(self.results) @@ -765,7 +765,7 @@ def resolve(cmd, st, project): out = c.stdout.read() if returncode != 0: st.console.print(environments.PIPENV_SPINNER_FAIL_TEXT.format("Locking Failed!")) - err.print(out.strip()) + # err.print(out.strip()) if not is_verbose: err.print(errors) raise RuntimeError("Failed to lock Pipfile.lock!")