Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c874e7

Browse filesBrowse files
authored
Merge pull request #4962 from pypa/bugfix/4961-validated-eps
Update test to honor new behavior in importlib_metadata 8.7
2 parents ef4cd29 + 82c588a commit 2c874e7
Copy full SHA for 2c874e7

File tree

Expand file treeCollapse file tree

3 files changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-2
lines changed

‎newsfragments/4961.bugfix.rst

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update test to honor new behavior in importlib_metadata 8.7.

‎setuptools/_entry_points.py

Copy file name to clipboardExpand all lines: setuptools/_entry_points.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def ensure_valid(ep):
1515
"""
1616
Exercise one of the dynamic properties to trigger
1717
the pattern match.
18+
19+
This function is deprecated in favor of importlib_metadata 8.7 and
20+
Python 3.14 importlib.metadata, which validates entry points on
21+
construction.
1822
"""
1923
try:
2024
ep.extras

‎setuptools/tests/test_egg_info.py

Copy file name to clipboardExpand all lines: setuptools/tests/test_egg_info.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,10 +1287,11 @@ def test_invalid_entry_point(self, tmpdir_cwd, env):
12871287
dist = Distribution({"name": "foo", "version": "0.0.1"})
12881288
dist.entry_points = {"foo": "foo = invalid-identifier:foo"}
12891289
cmd = dist.get_command_obj("egg_info")
1290-
expected_msg = r"Problems to parse .*invalid-identifier.*"
1291-
with pytest.raises(errors.OptionError, match=expected_msg) as ex:
1290+
expected_msg = r"(Invalid object reference|Problems to parse)"
1291+
with pytest.raises((errors.OptionError, ValueError), match=expected_msg) as ex:
12921292
write_entries(cmd, "entry_points", "entry_points.txt")
12931293
assert "ensure entry-point follows the spec" in ex.value.args[0]
1294+
assert "invalid-identifier" in str(ex.value)
12941295

12951296
def test_valid_entry_point(self, tmpdir_cwd, env):
12961297
dist = Distribution({"name": "foo", "version": "0.0.1"})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.