fix(http-client-python): preserve customized pyproject.toml fields#2
Closed
l0lawrence wants to merge 1 commit into
Closed
fix(http-client-python): preserve customized pyproject.toml fields#2l0lawrence wants to merge 1 commit into
l0lawrence wants to merge 1 commit into
Conversation
Preserve manually customized description, classifiers, and [project.urls] fields from an existing pyproject.toml instead of overwriting them on emit. Fixes microsoft#10311 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
All changed packages have been documented.
Show changes
|
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.
Fixes microsoft#10311
Problem
The Python emitter regenerates
pyproject.tomlon every emit and clobbers manual edits to fields it doesn't own — for example downcasing "AI" to "Ai" in thedescription, dropping Python versions from theclassifierslist, and replacing a custom repository URL with the generic Azure SDK one.Fix
Extend the existing
KEEP_FIELDSpreservation mechanism so the emitter preserves the following from an existingpyproject.tomlinstead of overwriting them:project.descriptionproject.classifiers[project.urls]On first emit (no existing file) these are still generated as before. When the file already exists, the user's values are carried through.
Changes
general_serializer.py: extractdescription,classifiers, andurlsintoKEEP_FIELDS.pyproject.toml.jinja2: use preserved values when present, fall back to generated defaults otherwise.tests/unit/test_pyproject_keep_fields.py.Validation
tomli).