summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-11-15 15:05:48 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-11-15 15:05:48 +0000
commit94dcd5da01b83458af72406a955dc5d3fd32b339 (patch)
tree31dfc11bee7290bd527b05e8b1f4fa007bb3cc6a
parenta0e8e53cecc238e3bce2247308fe7dd94114ef35 (diff)
downloadpython-setuptools-git-94dcd5da01b83458af72406a955dc5d3fd32b339.tar.gz
Display a user-friendly exception when entry-point is invalid
-rw-r--r--setuptools/_entry_points.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/setuptools/_entry_points.py b/setuptools/_entry_points.py
index f087681b..a2346342 100644
--- a/setuptools/_entry_points.py
+++ b/setuptools/_entry_points.py
@@ -2,6 +2,7 @@ import functools
import operator
import itertools
+from .errors import OptionError
from .extern.jaraco.text import yield_lines
from .extern.jaraco.functools import pass_none
from ._importlib import metadata
@@ -14,7 +15,14 @@ def ensure_valid(ep):
Exercise one of the dynamic properties to trigger
the pattern match.
"""
- ep.extras
+ try:
+ ep.extras
+ except AttributeError as ex:
+ msg = (
+ f"Problems to parse {ep}.\nPlease ensure entry-point follows the spec: "
+ "https://packaging.python.org/en/latest/specifications/entry-points/"
+ )
+ raise OptionError(msg) from ex
def load_group(value, group):