Repository navigation
fix(python): stabilize generated imports for 3.9.9 - #598
Merged
Merged
Conversation
Sort named-type imports before rendering Python classes and test modules. Verify production source bytes across three fresh-process hash seeds while retaining random Avro test sample values. Prepare the 3.9.9 patch release. Fixes #597 Signed-off-by: Clemens Vasters <clemens@vasters.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Draft and incomplete pull requests are welcome.
What changed and why?
Fixes #597. Sort named-type imports before rendering Python production classes and generated test modules. This follows the existing JSON Structure-to-Python converter pattern.
The regression runs the real converter in three fresh Python processes with different hash seeds and compares every production Python source byte. Every emitted Python file is also compiled. Avro test sample values remain random; neither generated output nor sample values are normalized.
Prepare immutable 3.9.9 release notes and align the MCP package metadata. Schema types, field order and serialization behavior are unchanged.
How did you check it?
$pydenotes the isolated Python 3.11.9 validation interpreter; commands run from the repository root with local source imports.& $py -m pytest test\test_avrotopython.py -k dependency_imports_are_reproducible_across_hash_seeds --no-header -q -p no:cacheprovider --basetemp tmp\597-red-work\pytest— 1 failed, as expected; the generated production record changed with hash seed 2.& $py -m pytest test\test_avrotopython.py -k 'dependency_imports_are_reproducible_across_hash_seeds or record_union_branches_accept_instances_and_dictionaries or nested_collection_records_preserve_temporal_and_binary_json_values or nullable_falsy_values_survive_json_and_avro_roundtrips or no_double_test_prefix_in_import_types' --no-header -q -p no:cacheprovider --basetemp tmp\597-green-work\pytest— 5 passed, 7 subtests passed.git --no-pager diff --check— passed.3.9.9— passed. Full publisher schema validation remains the normal CI check.The full multi-language suite and release publication were not run locally; normal exact-head CI and tag gates must pass before publication.
Anything else? (optional)
The downstream xrcg 0.11.5 repair for xregistry/codegen#723 requires this released converter fix. Its local combined regression run passed with this source, but that is not PyPI-byte qualification.
Existing tags remain unchanged. No hash-seed workaround, generated-file edit, deployment change or credential work.