Skip to content

Commit 51362d4

Browse files
committed
Test warnings for dynamic scripts when entry-points is not dynamic
1 parent be6c021 commit 51362d4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

setuptools/tests/config/test_apply_pyprojecttoml.py

+12
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,18 @@ def test_optional_dependencies_dont_remove_env_markers(self, tmp_path):
363363
assert "importlib-resources" in reqs
364364
assert "bar" in reqs
365365

366+
@pytest.mark.parametrize(
367+
"field,group",
368+
[("scripts", "console_scripts"), ("gui-scripts", "gui_scripts")]
369+
)
370+
@pytest.mark.filterwarnings("error")
371+
def test_scripts_dont_require_dynamic_entry_points(self, tmp_path, field, group):
372+
# Issue 3862
373+
pyproject = self.pyproject(tmp_path, [field])
374+
dist = makedist(tmp_path, entry_points={group: ["foobar=foobar:main"]})
375+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
376+
assert group in dist.entry_points
377+
366378

367379
class TestMeta:
368380
def test_example_file_in_sdist(self, setuptools_sdist):

0 commit comments

Comments
 (0)