diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-03-20 19:55:35 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-03-20 19:55:35 +0000 |
| commit | d27b6b95b56391c1c8e68460cc97fb23a62b80ad (patch) | |
| tree | 0732ce4b5aacd07fe53c37076e2256dad6809fec | |
| parent | 51362d443d57715006dbff9eb282647e5047ce71 (diff) | |
| download | python-setuptools-git-d27b6b95b56391c1c8e68460cc97fb23a62b80ad.tar.gz | |
Fix '_WouldIgnoreField' warnings for scripts/gui_scripts
| -rw-r--r-- | setuptools/config/_apply_pyprojecttoml.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/setuptools/config/_apply_pyprojecttoml.py b/setuptools/config/_apply_pyprojecttoml.py index c805e639..a2b44365 100644 --- a/setuptools/config/_apply_pyprojecttoml.py +++ b/setuptools/config/_apply_pyprojecttoml.py @@ -279,6 +279,12 @@ def _normalise_cmd_options(desc: List[Tuple[str, Optional[str], str]]) -> Set[st return {_normalise_cmd_option_key(fancy_option[0]) for fancy_option in desc} +def _get_previous_entrypoints(dist: "Distribution") -> Dict[str, list]: + ignore = ("console_scripts", "gui_scripts") + value = getattr(dist, "entry_points", None) or {} + return {k: v for k, v in value.items() if k not in ignore} + + def _attrgetter(attr): """ Similar to ``operator.attrgetter`` but returns None if ``attr`` is not found @@ -343,7 +349,7 @@ _PREVIOUSLY_DEFINED = { "keywords": _attrgetter("metadata.keywords"), "classifiers": _attrgetter("metadata.classifiers"), "urls": _attrgetter("metadata.project_urls"), - "entry-points": _attrgetter("entry_points"), + "entry-points": _get_previous_entrypoints, "dependencies": _some_attrgetter("_orig_install_requires", "install_requires"), "optional-dependencies": _some_attrgetter("_orig_extras_require", "extras_require"), } |
