Skip to content
Merged
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
2 changes: 2 additions & 0 deletions news/13548.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix regression in configuration parsing that was turning a single value
into a list and thus leading to a validation error.
6 changes: 3 additions & 3 deletions src/pip/_internal/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def _get_ordered_configuration_items(
if section in override_order:
section_items[section].append((key, val))

# Yield each group in their override order
for section in override_order:
yield from section_items[section]
# Yield each group in their override order
for section in override_order:
yield from section_items[section]

def _update_defaults(self, defaults: dict[str, Any]) -> dict[str, Any]:
"""Updates the given defaults with values from the config files and
Expand Down
22 changes: 21 additions & 1 deletion tests/functional/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import sys
import textwrap

import pytest

from pip._internal.cli.status_codes import ERROR
from pip._internal.configuration import CONFIG_BASENAME, Kind
from pip._internal.configuration import get_configuration_files as _get_config_files
from pip._internal.utils.compat import WINDOWS

from tests.lib import PipTestEnvironment
from tests.lib import PipTestEnvironment, TestData
from tests.lib.configuration_helpers import ConfigurationMixin, kinds
from tests.lib.venv import VirtualEnvironment

Expand Down Expand Up @@ -212,3 +214,21 @@ def test_config_separated(
),
result.stdout,
)

@pytest.mark.network
def test_editable_mode_default_config(
self, script: PipTestEnvironment, data: TestData
) -> None:
"""Test that setting default editable mode through configuration works
as expected.
"""
script.pip(
"config", "--site", "set", "install.config-settings", "editable_mode=strict"
)
to_install = data.src.joinpath("simplewheel-1.0")
script.pip("install", "-e", to_install)
assert os.path.isdir(
os.path.join(
to_install, "build", "__editable__.simplewheel-1.0-py3-none-any"
)
)
Loading