Remove all Python behaviour where "sys.version_info" check is for Python < 3.9
Categories
(Firefox Build System :: Mach Core, task, P3)
Tracking
(Not tracked)
People
(Reporter: mhentges, Assigned: jocelyne.ah1, Mentored)
Details
(Keywords: good-first-bug, Whiteboard: [lang=python])
Attachments
(1 file)
We have a bunch of code that only runs for older Python versions. Now that Mach always runs with 3.6+, we should detect the version_info checks that are now dead code, and delete accordingly. This should simplify our codebase nicely.
Notes:
- Careful for files that are used by Python 2 CI tasks. Some
tryruns associated with these changes would not go amiss. - While doing this ticket, leave third-party usages of
sys.version_infoalone. That'll be fixed when we upgrade vendored packages.
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Updated•4 years ago
|
Comment 1•1 year ago
|
||
source code which sys.version_info < (3, 6): can be removed,
This code returns the command that some code requires Python 3.5 or greater.
if sys.version_info[0:2] < (3, 5):
print('run-task-wrapper requires Python 3.5+')
sys.exit(1)
Comment 2•1 year ago
|
||
Taegeon, would you like to give it a try?
Updated•1 year ago
|
Comment 3•5 months ago
|
||
Hi Sylvestre,
I'm a new contributor and I'd like to work on this bug. I've already started looking into removing sys.version_info checks for Python < 3.9 in some files. Is it okay to check Python < 3.9 as mach is using 3.9 now? check here
Could I take this bug? I’ll make sure to avoid third-party code and test changes properly.
And I'm interested in discussing my findings.
Thanks!
Updated•5 months ago
|
| Assignee | ||
Comment 5•6 days ago
|
||
Picking this up as a good-first-bug, I found the work here already landed under bug 2018019 (already linked as "See also"), which resolved FIXED in Firefox 150 on 2026-02-27.
Per its comment 6, that stack:
- replaced
mozbuild.util.memoized_propertywithfunctools.cached_property - replaced
mozbuild.util.memoizewithfunctools.cache - removed both hand-rolled classes.
I confirmed in current mozilla-central that util.py no longer defines either, and there are no remaining first-party imports of them. This matches the direction in comments 9 and 10. The original kwargs ask (comment 0) is covered too, since functools.cache handles kwargs.
Looks like this can be closed as RESOLVED DUPLICATE of bug 2018019.
| Assignee | ||
Comment 6•6 days ago
|
||
Apologies, this comment was posted here by mistake; it was meant for bug 1637820. Please disregard.
| Assignee | ||
Comment 7•6 days ago
|
||
Updated•6 days ago
|
Description
•