661: update supported python versions #706
Merged
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.
Closes #661
Closes #701
with
to group contextsWhy is this the best possible solution? Were any other approaches considered?
Considered including 3.8 (EOL 2024-10) and 3.9 (EOL 2025-10) but that would have meant testing on 5 different major Python versions or excluding newer versions, being limited to the oldest version's syntax, and increasing the potential for code or library incompatibilities. Also, lately we have updated Python version support every 2 years (2020, 2022, 2024) so these would have gone out of support by 2026.
Considered supporting 3.12 only (in line with pyODK) but according to these PyPi stats it's adoption is about 5% as of 2024-05-04. Adoption of 3.10 to 3.12 inclusive is more like 40%. Using 3.10 as the default / lowest version allows for nice things like the newer typing syntax and structural pattern matching.
What are the regression risks?
The py3.10 typing syntax would throw an error for older Python versions. The f-strings replacements were fiddly and so could be off but I checked them over a few times and the tests pass.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Yes, the README is updated.
Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyxform tests
andruff check pyxform tests
to lint code