[http-client-python] add pyproject toml#7829
Conversation
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
There was a problem hiding this comment.
Pull Request Overview
This PR replaces setup.py with a pyproject.toml-based build for the Python HTTP client generator, adds a corresponding template and retention logic, and updates related packaging dependencies.
- Added
pyproject.toml.jinja2template and support in the serializer - Updated serializer to remove
setup.py, retain existingpyproject.tomlfields, and manage version comparisons - Adjusted
package.jsonto include new dependencies for Python client generation
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/http-client-python/package.json | Added new dependencies and reordered existing ones for Python codegen |
| generator/pygen/codegen/templates/.../pyproject.toml.jinja2 | Introduced pyproject.toml template for packaging |
| generator/pygen/codegen/serializers/general_serializer.py | Added methods to extract and retain pyproject.toml fields, removed setup.py code paths |
| generator/pygen/codegen/serializers/init.py | Swapped out setup.py.jinja2 for pyproject.toml.jinja2, updated regeneration logic |
| generator/pygen/init.py | Added remove_file helper to delete setup.py |
| cspell.yaml | Added pytyped to the spelling dictionary |
Files not reviewed (1)
- packages/http-client-python/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
packages/http-client-python/generator/pygen/codegen/serializers/general_serializer.py:63
- The logic for retaining existing
pyproject.tomlfields isn't covered by tests. Add unit tests for_keep_pyproject_fieldsto ensure dependencies and build-tool settings are correctly preserved.
def _keep_pyproject_fields(self, file_path: str) -> dict:
packages/http-client-python/generator/pygen/codegen/templates/packaging_templates/pyproject.toml.jinja2:86
- There is no newline between the closing
{% endif %}and thereadmeline, which will produce invalid TOML. Add a line break soreadme = ...appears on its own line.
{% endif %}readme = {file = ["README.md"], content-type = "text/markdown"}
packages/http-client-python/generator/pygen/codegen/serializers/general_serializer.py
Outdated
Show resolved
Hide resolved
…or apiview src dir pick up
|
@iscai-msft PR approved. Please hold on release for typespec-python if after the PR merged since I need some time to adjust the generation scripts of SDK repo. |
fix #7975
Changes to http-client-python:
keep-setup-pyto keep the existing setup.py. Thebasic-setup-pyoption can continue to be used to generate a basic setup.py file.