Skip to content

Commit

Permalink
Caching properties to deduplicate sources
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
kalebmckale committed Aug 23, 2023
1 parent 76bcb90 commit 8716271
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pipenv/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pipenv/utils/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8716271

Please sign in to comment.