Repository navigation
refactor: remove pre-Python 3.10 leftovers - #10525
Open
wittachai-as wants to merge 1 commit into
Open
wittachai-as wants to merge 1 commit into
wittachai-as wants to merge 1 commit into
Conversation
setup.py declares python_requires=">=3.10", so these branches can never be taken on a supported interpreter: - celery/utils/imports.py: the `sys.version_info >= (3, 10)` gate around `entry_points(group=namespace)` is always true; the fallback is dead. - celery/utils/time.py: the `backports.zoneinfo` fallback for < 3.9 is unreachable — `zoneinfo` has been in the stdlib since 3.9. `sys` is no longer used in this module, so the import goes too. - setup.cfg: the bdist_rpm requirement on `backports.zoneinfo>=0.2.1;python_version<'3.9'` can never apply. No behaviour change on any supported version. Rebased on current main and reduced in scope: this PR previously also rewrote the `owned_by` loop in celery/concurrency/asynpool.py, which was handled upstream in celery#10742, so that change is dropped here.
wittachai-as
force-pushed
the
remove-pre-310-leftovers
branch
from
October 2, 2026 17:36
3305253 to
48e4d8d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Celery's floor is
python_requires=">=3.10"(setup.py). This PR removes leftovers from before that floor. Every item is provable from the project's own metadata, and there is no behavior change on any supported Python version.celery/utils/time.py:if sys.version_info >= (3, 9)is always true on 3.10+, so the else-branch importingbackports.zoneinfois dead code. Unwrapped to a plainfrom zoneinfo import ZoneInfoand dropped the now-unusedimport sys.celery/utils/imports.py:if sys.version_info >= (3, 10)is always true. Removed the dead fallback for olderimportlib.metadataAPIs.celery/concurrency/asynpool.py: performed the rewrite the TODO was waiting for ("once we drop support for Python 3.7"). The loop is now the dict comprehension with the walrus operator the comment described.setup.cfg: removedbackports.zoneinfo>=0.2.1;python_version<'3.9'from[bdist_rpm] requires. Under a 3.10 floor that environment marker can never be satisfied.Found while auditing version-gated leftovers in popular open-source projects.