diff --git a/src/shiv/cli.py b/src/shiv/cli.py index 8f5c93e..58b15cf 100644 --- a/src/shiv/cli.py +++ b/src/shiv/cli.py @@ -39,7 +39,7 @@ def find_entry_point(site_packages_dirs: List[Path], console_script: str) -> str :param console_script: A console_script string. """ - config_parser = ConfigParser() + config_parser = ConfigParser(delimiters=("=",)) for site_packages in site_packages_dirs: # noinspection PyTypeChecker diff --git a/test/test_cli.py b/test/test_cli.py index bd1af23..084a38f 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -61,6 +61,18 @@ def test_find_entry_point_two_points(self, tmpdir, package_location): install(["-t", str(tmpdir), str(package_location)]) assert find_entry_point([Path(tmpdir)], "hello") == "hello:main" + def test_find_entry_point_with_colons_in_plugin_names(self, tmp_path): + metadata = tmp_path / "example.dist-info" + metadata.mkdir() + (metadata / "entry_points.txt").write_text( + "[console_scripts]\nhello = hello:main\n\n" + "[example.formatters]\n" + "{:.5f} = example:float_formatter\n" + "{:2.3e} = example:exponential_formatter\n" + ) + + assert find_entry_point([tmp_path], "hello") == "hello:main" + def test_console_script_exists(self, tmp_path, package_location): """Test that we can check console_script presence.""" install_dir = tmp_path / "install"