Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add new hook 'setuptools.finalize_distribution_options' #1877
At this point, I'm prepared to accept this feature at least experimentally for setuptools_scm to leverage. I still have one lingering concern:
To that end, I've added this patch locally:
diff --git a/setuptools/dist.py b/setuptools/dist.py index 44990431..b2bdc409 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -7,6 +7,7 @@ import re import os import warnings import numbers +import random import distutils.log import distutils.core import distutils.cmd @@ -734,8 +735,9 @@ class Distribution(_Distribution): def by_order(hook): return getattr(hook, 'order', 0) - eps = pkg_resources.iter_entry_points(hook_key) - for ep in sorted(eps, key=by_order): + eps = list(pkg_resources.iter_entry_points(hook_key)) + random.shuffle(eps) + for ep in eps: ep.load()(self) def _finalize_setup_keywords(self):
And then run the tests several times, which gives me strong confidence that there's no order dependency on the built-in finalizers, so I'm comfortable leaving the default finalizers at the default order index of 0.
Paul, since you were looking at the reported ticket, would you review this change?