blob: 149d8ad5ceae8c7dbf8bda1668f8727b879b0f4b [file] [log] [blame]
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001The License-File lines in PKG-INFO change ordering depending on the order on disk,
2for example for python-packaging, one build shows:
3
4License-File: LICENSE
5License-File: LICENSE.APACHE
6License-File: LICENSE.BSD
7
8and the other shows:
9
10License-File: LICENSE
11License-File: LICENSE.BSD
12License-File: LICENSE.APACHE
13
14This is because glob uses os.listdir() which is unsorted. Sort the result to avoid this.
15
16Upstream-Status: Submitted [https://github.com/pypa/setuptools/issues/2691]
17Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
18
19Index: setuptools-57.0.0/setuptools/dist.py
20===================================================================
21--- setuptools-57.0.0.orig/setuptools/dist.py
22+++ setuptools-57.0.0/setuptools/dist.py
23@@ -15,7 +15,7 @@ import distutils.command
24 from distutils.util import strtobool
25 from distutils.debug import DEBUG
26 from distutils.fancy_getopt import translate_longopt
27-from glob import iglob
28+from glob import glob
29 import itertools
30 import textwrap
31 from typing import List, Optional, TYPE_CHECKING
32@@ -603,7 +603,7 @@ class Distribution(_Distribution):
33 return (
34 path
35 for pattern in patterns
36- for path in iglob(pattern)
37+ for path in sorted(glob(pattern))
38 if not path.endswith('~')
39 and os.path.isfile(path)
40 )