summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-02-15 18:16:14 -0500
committerGitHub <noreply@github.com>2020-02-15 18:16:14 -0500
commitad8bfa8825f2a773d255a43166a9f3f9740696c7 (patch)
tree293c6d670e66b363af6e9361d459e4e903f9fc86
parentfd25f0cdaa63f20effefc96f195b0e909fac8c75 (diff)
parent3f8fb00e442d110129e7d77b8104e4774a11ef92 (diff)
downloadpython-setuptools-git-ad8bfa8825f2a773d255a43166a9f3f9740696c7.tar.gz
Merge pull request #1994 from con-f-use/master
honor order attribute in "finalize_distibution_options" group of entrypoints
-rw-r--r--changelog.d/1994.change.rst1
-rw-r--r--setuptools/dist.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/changelog.d/1994.change.rst b/changelog.d/1994.change.rst
new file mode 100644
index 00000000..4a6cc742
--- /dev/null
+++ b/changelog.d/1994.change.rst
@@ -0,0 +1 @@
+Fixed a bug in the "setuptools.finalize_distribution_options" hook that lead to ignoring the order attribute of entry points managed by this hook.
diff --git a/setuptools/dist.py b/setuptools/dist.py
index fe5adf46..f6453a08 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -731,13 +731,13 @@ class Distribution(_Distribution):
to influence the order of execution. Smaller numbers
go first and the default is 0.
"""
- hook_key = 'setuptools.finalize_distribution_options'
+ group = 'setuptools.finalize_distribution_options'
def by_order(hook):
return getattr(hook, 'order', 0)
- eps = pkg_resources.iter_entry_points(hook_key)
+ eps = map(lambda e: e.load(), pkg_resources.iter_entry_points(group))
for ep in sorted(eps, key=by_order):
- ep.load()(self)
+ ep(self)
def _finalize_setup_keywords(self):
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):