summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Suozzo <msuozzo@google.com>2021-10-30 12:06:15 -0400
committerGitHub <noreply@github.com>2021-10-30 12:06:15 -0400
commitb42ec23633cf81aa9e50f6e44d6ff33fd796293b (patch)
treeda42288e5c15cbead1f80217898dc65419c06a39
parent4bce6d5a30accecc848d8e7f0dabd212bfea9475 (diff)
downloadpython-setuptools-git-b42ec23633cf81aa9e50f6e44d6ff33fd796293b.tar.gz
Maintain `requires` order in METADATA.
It seems that workflows that build -> install -> build would have the order of requires changed by these sorted() calls. From a brief attempt to trace through all the related interfaces, it seems this is the only code that changes the order of the requirements and so would be the only source of the observed inconsistency of Requires-Dist entries. If this sorting is desirable, the other setuptools and wheel interfaces that interact with the requirements should also sort them. Otherwise, it's valuable to retain the order across all parts of the system.
-rw-r--r--setuptools/wheel.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/wheel.py b/setuptools/wheel.py
index 0be811af..722264f6 100644
--- a/setuptools/wheel.py
+++ b/setuptools/wheel.py
@@ -133,16 +133,16 @@ class Wheel:
# Note: Evaluate and strip markers now,
# as it's difficult to convert back from the syntax:
# foobar; "linux" in sys_platform and extra == 'test'
- def raw_req(req):
+ def to_raw(req):
req.marker = None
return str(req)
- install_requires = list(sorted(map(raw_req, dist.requires())))
+ install_requires = list(map(raw_req, dist.requires()))
extras_require = {
- extra: sorted(
+ extra: [
req
for req in map(raw_req, dist.requires((extra,)))
if req not in install_requires
- )
+ ]
for extra in dist.extras
}
os.rename(dist_info, egg_info)