feat(python): allow default version to be overridden#4206
feat(python): allow default version to be overridden#4206jskeet merged 2 commits intogoogleapis:mainfrom
Conversation
Adds PythonPackage.DefaultVersion which is populated during migration, if and only if it is not the same as the final part of the first API path, and then uses this override in repo metadata generation. Additionally, the toAPIs code in the migration tool now sorts the APIs by path before returning the list. This means that migration can process the APIs in the same order they'll be saved at the end. Fixes googleapis#3146
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4206 +/- ##
==========================================
+ Coverage 81.67% 81.69% +0.01%
==========================================
Files 87 87
Lines 6952 6959 +7
==========================================
+ Hits 5678 5685 +7
Misses 903 903
Partials 371 371 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements the ability to override the default version for Python packages by adding a DefaultVersion field. The changes are well-contained, and the implementation in both the generation logic and the migration tool is sound. The addition of API sorting in the migration tool is a good improvement for determinism. I've included a couple of minor suggestions to improve code style consistency and slightly optimize the logic.
|
Note: although this is under discussion in #4205, I think it would be reasonable to merge this PR as a stepping-stone, then we can make the default selection more robust. |
Adds PythonPackage.DefaultVersion which is populated during migration, if and only if it is not the same as the final part of the first API path, and then uses this override in repo metadata generation.
Additionally, the toAPIs code in the migration tool now sorts the APIs by path before returning the list. This means that migration can process the APIs in the same order they'll be saved at the end.
Fixes #3146