Skip to content

Commit

Permalink
expose this new caching with --use-feature=metadata-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Sep 3, 2023
1 parent 4b9c97f commit 5463825
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/12256.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Introduce ``--use-feature=metadata-cache`` to cache metadata lookups in ``~/.cache/pip/link-metadata``.
1 change: 1 addition & 0 deletions src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ def check_list_path_option(options: Values) -> None:
choices=[
"fast-deps",
"truststore",
"metadata-cache",
]
+ ALWAYS_ENABLED_FEATURES,
help="Enable new functionality, that may be backward incompatible.",
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def make_requirement_preparer(
"fast-deps has no effect when used with the legacy resolver."
)

if options.cache_dir:
if bool(options.cache_dir) and ("metadata-cache" in options.features_enabled):
metadata_cache = LinkMetadataCache(options.cache_dir)
else:
metadata_cache = None
Expand Down

0 comments on commit 5463825

Please sign in to comment.