fix(http-client-python): preserve customized pyproject.toml fields#10987
Merged
l0lawrence merged 8 commits intoJun 19, 2026
Merged
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>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Add a keep-pyproject-fields emitter option so description, classifiers, and [project.urls] in an existing pyproject.toml are only preserved when the option is explicitly enabled in tspconfig.yaml. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
naming question and how much do we want the user to be able to preserve? |
iscai-msft
approved these changes
Jun 15, 2026
msyyc
reviewed
Jun 16, 2026
Per review feedback, change keep-pyproject-fields from a boolean toggle to a comma-separated list of project fields (authors, description, classifiers, urls) so users can choose exactly which fields to preserve. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exercise the real OptionsDict -> parse -> keep -> template render chain to verify selecting specific fields preserves only those and regenerates the rest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Fixes #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).