summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-setuptools/reproducibility.patch
blob: 149d8ad5ceae8c7dbf8bda1668f8727b879b0f4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
The License-File lines in PKG-INFO change ordering depending on the order on disk, 
for example for python-packaging, one build shows:

License-File: LICENSE
License-File: LICENSE.APACHE
License-File: LICENSE.BSD

and the other shows:

License-File: LICENSE
License-File: LICENSE.BSD
License-File: LICENSE.APACHE

This is because glob uses os.listdir() which is unsorted. Sort the result to avoid this.

Upstream-Status: Submitted [https://github.com/pypa/setuptools/issues/2691]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Index: setuptools-57.0.0/setuptools/dist.py
===================================================================
--- setuptools-57.0.0.orig/setuptools/dist.py
+++ setuptools-57.0.0/setuptools/dist.py
@@ -15,7 +15,7 @@ import distutils.command
 from distutils.util import strtobool
 from distutils.debug import DEBUG
 from distutils.fancy_getopt import translate_longopt
-from glob import iglob
+from glob import glob
 import itertools
 import textwrap
 from typing import List, Optional, TYPE_CHECKING
@@ -603,7 +603,7 @@ class Distribution(_Distribution):
         return (
             path
             for pattern in patterns
-            for path in iglob(pattern)
+            for path in sorted(glob(pattern))
             if not path.endswith('~')
             and os.path.isfile(path)
         )