Skip to content

Commit

Permalink
Re-use ensure_valid in validate.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 12, 2022
1 parent 3d5f9d1 commit f4b0e3a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions setuptools/_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .extern.jaraco.functools import pass_none
from ._importlib import metadata
from ._itertools import ensure_unique
from .extern.more_itertools import consume


def ensure_valid(ep):
Expand All @@ -14,7 +15,6 @@ def ensure_valid(ep):
the pattern match.
"""
ep.extras
return ep


def load_group(value, group):
Expand All @@ -34,11 +34,9 @@ def by_group_and_name(ep):

def validate(eps: metadata.EntryPoints):
"""
Ensure entry points are unique by group and name and validate the pattern.
Ensure entry points are unique by group and name and validate each.
"""
for ep in ensure_unique(eps, key=by_group_and_name):
# exercise one of the dynamic properties to trigger validation
ep.extras
consume(map(ensure_valid, ensure_unique(eps, key=by_group_and_name)))
return eps


Expand Down

0 comments on commit f4b0e3a

Please sign in to comment.