Drop Python 3.10 support#1444
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR drops Python 3.10 support across the generator, its templates, and test fixtures by raising the minimum supported Python version to 3.11 and removing 3.10 compatibility workarounds.
Changes:
- Raise minimum supported Python version to 3.11 in project metadata, templates, CI, and test projects.
- Simplify enums and datetime parsing now that Python 3.11 features/behavior are available (e.g.,
StrEnum,datetime.UTC, relaxedfromisoformathandling). - Refresh lockfiles and golden records/integration fixtures to align with the new minimum version.
Reviewed changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_templates/test_property_templates/test_datetime_property/required_not_null.py | Updates the datetime template snapshot expectation to remove the Z normalization workaround. |
| pyproject.toml | Bumps requires-python to >=3.11 and removes the Python 3.10 classifier. |
| pdm.minimal.lock | Regenerates minimal lock targeting Python 3.11 (drops 3.10-only/backport deps). |
| pdm.lock | Regenerates lock targeting Python 3.11 (also includes some dependency patch bumps). |
| openapi_python_client/templates/setup.py.jinja | Updates generated python_requires to >=3.11. |
| openapi_python_client/templates/pyproject_uv.toml.jinja | Updates generated requires-python to >=3.11. |
| openapi_python_client/templates/pyproject_poetry.toml.jinja | Updates generated Poetry python constraint to ^3.11. |
| openapi_python_client/templates/pyproject_pdm.toml.jinja | Updates generated requires-python to >=3.11. |
| openapi_python_client/templates/property_templates/datetime_property.py.jinja | Removes Python 3.10-specific Z replacement before fromisoformat. |
| openapi_python_client/schema/parameter_location.py | Switches to StrEnum and removes version-conditional enum implementation. |
| openapi_python_client/schema/data_type.py | Switches DataType to StrEnum. |
| openapi_python_client/parser/properties/datetime.py | Removes Z normalization and validates/constructs datetime directly via fromisoformat. |
| openapi_python_client/parser/bodies.py | Switches BodyType to StrEnum and removes version-conditional enum implementation. |
| openapi_python_client/config.py | Switches MetaType to StrEnum. |
| integration-tests/tests/test_api/test_body/test_post_body_multipart.py | Uses datetime.UTC/UTC instead of timezone.utc for 3.11+. |
| integration-tests/pyproject.toml | Bumps integration test project minimum Python to >=3.11. |
| integration-tests/pdm.minimal.lock | Regenerates integration minimal lock targeting Python 3.11. |
| integration-tests/pdm.lock | Regenerates integration lock targeting Python 3.11. |
| integration-tests/integration_tests/models/post_body_multipart_response_200.py | Removes Z replacement before fromisoformat in generated integration fixture code. |
| integration-tests/integration_tests/models/post_body_multipart_body.py | Removes Z replacement before fromisoformat in generated integration fixture code. |
| end_to_end_tests/test-3-1-golden-record/pyproject.toml | Bumps golden-record Poetry python constraint to ^3.11. |
| end_to_end_tests/metadata_snapshots/uv.pyproject.toml | Updates snapshot requires-python to >=3.11. |
| end_to_end_tests/metadata_snapshots/setup.py | Updates snapshot python_requires to >=3.11. |
| end_to_end_tests/metadata_snapshots/poetry.pyproject.toml | Updates snapshot Poetry python constraint to ^3.11. |
| end_to_end_tests/metadata_snapshots/pdm.pyproject.toml | Updates snapshot requires-python to >=3.11. |
| end_to_end_tests/literal-enums-golden-record/pyproject.toml | Bumps golden-record Poetry python constraint to ^3.11. |
| end_to_end_tests/golden-record/pyproject.toml | Bumps golden-record Poetry python constraint to ^3.11. |
| end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py | Removes Z replacement before fromisoformat in golden record. |
| end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py | Removes Z replacement before fromisoformat in golden record. |
| end_to_end_tests/golden-record/my_test_api_client/models/extended.py | Removes Z replacement before fromisoformat in golden record parsing helper. |
| end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py | Removes Z replacement before fromisoformat in golden record parsing helper. |
| end_to_end_tests/golden-record/my_test_api_client/models/a_model.py | Removes Z replacement before fromisoformat in golden record parsing helper. |
| end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py | Removes Z replacement before fromisoformat in multiple golden record parsing sites. |
| end_to_end_tests/functional_tests/generated_code_execution/test_properties.py | Uses datetime.UTC in functional test for 3.11+. |
| end_to_end_tests/functional_tests/generated_code_execution/test_defaults.py | Uses datetime.UTC in functional test defaults for 3.11+. |
| .github/workflows/checks.yml | Removes Python 3.10 from CI matrix and pins other jobs to 3.11+. |
| .changeset/drop_support_for_python_310.md | Adds a changeset marking the breaking change (major bump). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.