Skip to content

TESTING: Patch out the BASE configuration location) #11983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/pip/_internal/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_configuration_files() -> Dict[Kind, List[str]]:
os.path.join(path, CONFIG_BASENAME) for path in appdirs.site_config_dirs("pip")
]

base_config_file = os.path.join(sys.base_prefix, CONFIG_BASENAME)
# base_config_file = os.path.join(sys.base_prefix, CONFIG_BASENAME)
site_config_file = os.path.join(sys.prefix, CONFIG_BASENAME)
legacy_config_file = os.path.join(
os.path.expanduser("~"),
Expand All @@ -87,7 +87,8 @@ def get_configuration_files() -> Dict[Kind, List[str]]:
)
new_config_file = os.path.join(appdirs.user_config_dir("pip"), CONFIG_BASENAME)
return {
kinds.BASE: [base_config_file],
# TEMPORARY FIX: Remove BASE location
# kinds.BASE: [base_config_file],
kinds.GLOBAL: global_config_files,
kinds.SITE: [site_config_file],
kinds.USER: [legacy_config_file, new_config_file],
Expand Down Expand Up @@ -354,7 +355,8 @@ def iter_config_files(self) -> Iterable[Tuple[Kind, List[str]]]:
# The legacy config file is overridden by the new config file
yield kinds.USER, config_files[kinds.USER]

yield kinds.BASE, config_files[kinds.BASE]
# TEMPORARY FIX: Remove BASE location
# yield kinds.BASE, config_files[kinds.BASE]

# finally virtualenv configuration first trumping others
yield kinds.SITE, config_files[kinds.SITE]
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ def test_venv_config_file_found(self, monkeypatch: pytest.MonkeyPatch) -> None:
for _, val in cp.iter_config_files():
files.extend(val)

assert len(files) == 5
# TEMPORARY FIX: Remove BASE location
# expect 4, because base location is patched out
# assert len(files) == 5
assert len(files) == 4

@pytest.mark.parametrize(
"args, expect",
Expand Down