feat: Enforce Python 3.8+ requirement and add multi-version CI testing #440
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.
This PR aligns Python version requirements across documentation, packaging, and CI to prevent compatibility issues and make requirements explicit for contributors.
Changes
python_requires=">=3.8"to enforce minimum version at pip install timeRationale
This project already declares Python 3.8-3.12 support via setup.py classifiers, but this requirement was not enforced or tested. This PR makes that declaration official and enforceable.
Why Python 3.8+ specifically:
Historical context:
.format()strings and could technically support Python 3.0+The gap this fixes:
Without explicit enforcement and CI testing, contributors could easily introduce incompatible syntax:
Common Python features that require newer versions:
f"hello {name}"- Already in codebase:=(PEP 572) -if (n := len(a)) > 10:|(PEP 584) -d1 | d2[](PEP 585) -list[int]instead ofList[int]X | Y(PEP 604) -def foo(x: int | str):These features are increasingly common in modern Python code. Without CI testing on all supported versions, a PR using these features could pass code review and break users on older Python versions.
Impact
Benefits
Drawbacks
Testing
python_requiresis a standard setuptools feature used by thousands of packagesThank you for reviewing and considering this change.