Skip to content

Commit 39e92c7

Browse files
authored
Merge branch 'main' into fix-doc-dependency-example
2 parents 66f5b8e + 81b3c05 commit 39e92c7

File tree

11 files changed

+47
-15
lines changed

11 files changed

+47
-15
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v5
32-
- uses: actions/setup-python@v5
32+
- uses: actions/setup-python@v6
3333
with:
3434
python-version: "3.x"
3535
- run: pip install nox
@@ -71,7 +71,7 @@ jobs:
7171

7272
steps:
7373
- uses: actions/checkout@v5
74-
- uses: actions/setup-python@v5
74+
- uses: actions/setup-python@v6
7575
with:
7676
python-version: "3.x"
7777
- name: Set up git credentials
@@ -95,7 +95,7 @@ jobs:
9595
9696
steps:
9797
- uses: actions/checkout@v5
98-
- uses: actions/setup-python@v5
98+
- uses: actions/setup-python@v6
9999
with:
100100
python-version: "3.x"
101101

@@ -126,7 +126,7 @@ jobs:
126126

127127
steps:
128128
- uses: actions/checkout@v5
129-
- uses: actions/setup-python@v5
129+
- uses: actions/setup-python@v6
130130
with:
131131
python-version: ${{ matrix.python }}
132132
allow-prereleases: true
@@ -196,7 +196,7 @@ jobs:
196196
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV
197197
198198
- uses: actions/checkout@v5
199-
- uses: actions/setup-python@v5
199+
- uses: actions/setup-python@v6
200200
with:
201201
python-version: ${{ matrix.python }}
202202
allow-prereleases: true
@@ -231,7 +231,7 @@ jobs:
231231
232232
steps:
233233
- uses: actions/checkout@v5
234-
- uses: actions/setup-python@v5
234+
- uses: actions/setup-python@v6
235235
with:
236236
python-version: "3.10"
237237

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
name: python-package-distributions
4242
path: dist/
4343
- name: Publish distribution 📦 to PyPI
44-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
44+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1

.github/workflows/update-rtd-redirects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
environment: RTD Deploys
2323
steps:
2424
- uses: actions/checkout@v5
25-
- uses: actions/setup-python@v5
25+
- uses: actions/setup-python@v6
2626
with:
2727
python-version: "3.11"
2828
- run: pipx run tools/update-rtd-redirects.py

news/13443.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Handle malformed ``Version`` metadata entries and
2+
show a sensible error message instead of crashing.

news/13523.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Permit spaces between a filepath and extras in an install requirement.

news/13548.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix regression in configuration parsing that was turning a single value
2+
into a list and thus leading to a validation error.

src/pip/_internal/cli/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ def _get_ordered_configuration_items(
203203
if section in override_order:
204204
section_items[section].append((key, val))
205205

206-
# Yield each group in their override order
207-
for section in override_order:
208-
yield from section_items[section]
206+
# Yield each group in their override order
207+
for section in override_order:
208+
yield from section_items[section]
209209

210210
def _update_defaults(self, defaults: dict[str, Any]) -> dict[str, Any]:
211211
"""Updates the given defaults with values from the config files and

src/pip/_internal/metadata/importlib/_dists.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from pip._internal.utils.wheel import parse_wheel, read_wheel_metadata_file
2929

3030
from ._compat import (
31+
BadMetadata,
3132
BasePath,
3233
get_dist_canonical_name,
3334
parse_name_and_version_from_info_directory,
@@ -165,9 +166,14 @@ def canonical_name(self) -> NormalizedName:
165166

166167
@property
167168
def version(self) -> Version:
168-
if version := parse_name_and_version_from_info_directory(self._dist)[1]:
169+
try:
170+
version = (
171+
parse_name_and_version_from_info_directory(self._dist)[1]
172+
or self._dist.version
173+
)
169174
return parse_version(version)
170-
return parse_version(self._dist.version)
175+
except TypeError:
176+
raise BadMetadata(self._dist, reason="invalid metadata entry `version`")
171177

172178
@property
173179
def raw_version(self) -> str:

src/pip/_internal/req/constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _strip_extras(path: str) -> tuple[str, str | None]:
4747
m = re.match(r"^(.+)(\[[^\]]+\])$", path)
4848
extras = None
4949
if m:
50-
path_no_extras = m.group(1)
50+
path_no_extras = m.group(1).rstrip()
5151
extras = m.group(2)
5252
else:
5353
path_no_extras = path

tests/functional/test_configuration.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
import sys
1010
import textwrap
1111

12+
import pytest
13+
1214
from pip._internal.cli.status_codes import ERROR
1315
from pip._internal.configuration import CONFIG_BASENAME, Kind
1416
from pip._internal.configuration import get_configuration_files as _get_config_files
1517
from pip._internal.utils.compat import WINDOWS
1618

17-
from tests.lib import PipTestEnvironment
19+
from tests.lib import PipTestEnvironment, TestData
1820
from tests.lib.configuration_helpers import ConfigurationMixin, kinds
1921
from tests.lib.venv import VirtualEnvironment
2022

@@ -212,3 +214,21 @@ def test_config_separated(
212214
),
213215
result.stdout,
214216
)
217+
218+
@pytest.mark.network
219+
def test_editable_mode_default_config(
220+
self, script: PipTestEnvironment, data: TestData
221+
) -> None:
222+
"""Test that setting default editable mode through configuration works
223+
as expected.
224+
"""
225+
script.pip(
226+
"config", "--site", "set", "install.config-settings", "editable_mode=strict"
227+
)
228+
to_install = data.src.joinpath("simplewheel-1.0")
229+
script.pip("install", "-e", to_install)
230+
assert os.path.isdir(
231+
os.path.join(
232+
to_install, "build", "__editable__.simplewheel-1.0-py3-none-any"
233+
)
234+
)

0 commit comments

Comments
 (0)