commit:     cc63aaba87ed789e8155d0eb1f3f9f2b5a77b67f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 15 05:23:30 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 18 04:39:10 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc63aaba

python-utils-r1.eclass: Preserve order in PYTEST_PLUGINS

Do not sort entry points when adding them to `PYTEST_PLUGINS`.
Apparently, the order of loading does matter, and reordering
the entry points from `dev-python/pytest-xdist` leads to warnings
that break the test suite of `dev-python/inline-snapshot`.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/43007
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/python-utils-r1.eclass | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 68faa9e2adf9..9cdfdc87019f 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1458,11 +1458,13 @@ epytest() {
                                                from importlib.metadata import 
distribution, entry_points
 
                                                packages = 
{distribution(x).name for x in sys.argv[1:]}
-                                               plugins = {
+                                               # In packages defining multiple 
entry points, we must
+                                               # list them in the same order!
+                                               plugins = (
                                                        x.value for x in 
entry_points(group="pytest11")
                                                        if x.dist.name in 
packages
-                                               }
-                                               
sys.stdout.write(",".join(sorted(plugins)))
+                                               )
+                                               
sys.stdout.write(",".join(plugins))
                                        EOF
                                )
                        else

Reply via email to