From 87162712a94c8a168afbd9688e16106355453803 Mon Sep 17 00:00:00 2001 From: kalebmckale Date: Wed, 23 Aug 2023 02:29:29 -0400 Subject: [PATCH] Caching properties to deduplicate sources Without caching, the Resolver will duplicate the sources listed in the `Pipfile` multiple times (since the property re-adds them every they're called) in the arguments sent to the `pip` parser. Removing unused command-line option `--debug` --- 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 3a7b1a3509..7a499a46ce 100644 --- a/pipenv/resolver.py +++ b/pipenv/resolver.py @@ -40,7 +40,6 @@ def get_parser(): action="store", default=None, ) - parser.add_argument("--debug", action="store_true", default=False) parser.add_argument("--system", action="store_true", default=False) parser.add_argument("--parse-only", action="store_true", default=False) parser.add_argument( diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py index fbe2e7f1da..418f9f4ac8 100644 --- a/pipenv/utils/resolver.py +++ b/pipenv/utils/resolver.py @@ -266,7 +266,7 @@ def prepare_pip_args(self, use_pep517=None, build_isolation=True): pip_args.extend(["--cache-dir", self.project.s.PIPENV_CACHE_DIR]) return pip_args - @property + @cached_property def pip_args(self): use_pep517 = environments.get_from_env("USE_PEP517", prefix="PIP") build_isolation = environments.get_from_env("BUILD_ISOLATION", prefix="PIP") @@ -298,7 +298,7 @@ def default_constraint_file(self): ) return default_constraint_filename - @property + @cached_property def pip_options(self): pip_options, _ = self.pip_command.parser.parse_args(self.pip_args) pip_options.cache_dir = self.project.s.PIPENV_CACHE_DIR