Skip to content

Comments

Hack: patch setuptools < 77 to support modern licenses#4931

Open
gpotter2 wants to merge 1 commit intosecdev:masterfrom
gpotter2:setuptools-77-hack
Open

Hack: patch setuptools < 77 to support modern licenses#4931
gpotter2 wants to merge 1 commit intosecdev:masterfrom
gpotter2:setuptools-77-hack

Conversation

@gpotter2
Copy link
Member

@gpotter2 gpotter2 commented Feb 23, 2026

This PR is a hack to support old setuptools with the new license format.

See 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.
image

@gpotter2 gpotter2 changed the title Hack: support setuptools < 77 with modern licenses Hack: patch setuptools < 77 to support modern licenses Feb 23, 2026
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.15%. Comparing base (5c3fe1c) to head (6fa4552).

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     

see 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return _apply(dist, config, filepath)

setuptools.dist.pyprojecttoml.apply_configuration = _patched_apply_configuration
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we get the exception and print it to ease debugging if needed?

@guedou
Copy link
Member

guedou commented Feb 24, 2026

LGTM. I made a minor comment.

@evverx
Copy link
Contributor

evverx commented Feb 24, 2026

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SetuptoolsDeprecationWarnings: "project.license as a TOML table is deprecated" and "License classifiers are deprecated"

3 participants