Hack: patch setuptools < 77 to support modern licenses#4931
Hack: patch setuptools < 77 to support modern licenses#4931gpotter2 wants to merge 1 commit intosecdev:masterfrom
Conversation
9be99ea to
61296b3
Compare
61296b3 to
6fa4552
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4931 +/- ##
==========================================
- Coverage 80.15% 80.15% -0.01%
==========================================
Files 370 370
Lines 91759 91759
==========================================
- Hits 73553 73552 -1
- Misses 18206 18207 +1 🚀 New features to boost your workflow:
|
| return _apply(dist, config, filepath) | ||
|
|
||
| setuptools.dist.pyprojecttoml.apply_configuration = _patched_apply_configuration | ||
| except Exception: |
There was a problem hiding this comment.
Shall we get the exception and print it to ease debugging if needed?
|
LGTM. I made a minor comment. |
|
@gpotter2 I have to admit I'm not sure what to do. Looking at https://pypistats.org/packages/scapy it seems Python3.7 jumped from ~17% to ~55% in October 2025 and even reached ~70% at some point and I don't even know how it can be explained. Personally I think it should be fine to keep emitting warnings with newer toolchains and cut off Python3.7/3.8 when the setuptools deadline gets close enough (or when it becomes too burdensome to support Python3.7/3.8 overall). Places with specific legacy requirements can always patch scapy. For example https://src.fedoraproject.org/rpms/scapy/blob/rawhide/f/scapy-2.7.0-rhel9.patch downgrades setuptools even more. |
This PR is a hack to support old setuptools with the new license format.
project.licenseas a TOML table is deprecated" and "License classifiers are deprecated" #4849See pypa/setuptools#4903 for more details. This should allow us to keep 3.7 support after all. @evverx what do you think?
As dumb as it is, Python 3.7 is still Scapy's biggest usage, by far.
