From 51362d443d57715006dbff9eb282647e5047ce71 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 20 Mar 2023 19:53:16 +0000 Subject: [PATCH] Test warnings for dynamic scripts when entry-points is not dynamic --- setuptools/tests/config/test_apply_pyprojecttoml.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setuptools/tests/config/test_apply_pyprojecttoml.py b/setuptools/tests/config/test_apply_pyprojecttoml.py index 3a66d494b3..0a34939a70 100644 --- a/setuptools/tests/config/test_apply_pyprojecttoml.py +++ b/setuptools/tests/config/test_apply_pyprojecttoml.py @@ -363,6 +363,18 @@ def test_optional_dependencies_dont_remove_env_markers(self, tmp_path): assert "importlib-resources" in reqs assert "bar" in reqs + @pytest.mark.parametrize( + "field,group", + [("scripts", "console_scripts"), ("gui-scripts", "gui_scripts")] + ) + @pytest.mark.filterwarnings("error") + def test_scripts_dont_require_dynamic_entry_points(self, tmp_path, field, group): + # Issue 3862 + pyproject = self.pyproject(tmp_path, [field]) + dist = makedist(tmp_path, entry_points={group: ["foobar=foobar:main"]}) + dist = pyprojecttoml.apply_configuration(dist, pyproject) + assert group in dist.entry_points + class TestMeta: def test_example_file_in_sdist(self, setuptools_sdist):