Skip to content

Commit

Permalink
Document edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Dec 21, 2022
1 parent 9c8e74b commit ee0ac23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pip/_internal/req/req_install.py
Expand Up @@ -151,6 +151,13 @@ def __init__(
self.hash_options = hash_options if hash_options else {}
self.config_settings = config_settings
if isinstance(comes_from, InstallRequirement) and comes_from.config_settings:
# 1. If a user-requested package has config settings, those are always used.
# 2. If a user-requested package does not have user-specified config.
# settings, but is another package’s transitive dependency, it would
# inherit the dependant’s config settings.
# 3. A transitive cannot have user-specified config settings.
# 4. If a transitive dependency’s dependant has config settings,
# the config settings are inherited.
self.config_settings = comes_from.config_settings
# Set to True after successful preparation of this requirement
self.prepared = False
Expand Down

0 comments on commit ee0ac23

Please sign in to comment.