Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Don't remove azure-sdk tool definitions from pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ def external_lib_version_map(self, file_content: str, additional_version_map: di
# If parsing the pyproject.toml fails, we assume the it does not exist or is incorrectly formatted.
return result

# Keep "azure-sdk-build" and "packaging" configuration
if "tool" in loaded_pyproject_toml and "azure-sdk-build" in loaded_pyproject_toml["tool"]:
result["KEEP_FIELDS"]["tool.azure-sdk-build"] = loaded_pyproject_toml["tool"]["azure-sdk-build"]
# Keep "azure-sdk-*" and "packaging" configuration
if "tool" in loaded_pyproject_toml:
for key in loaded_pyproject_toml["tool"]:
if key.startswith("azure-sdk"):
result["KEEP_FIELDS"][f"tool.{key}"] = loaded_pyproject_toml["tool"][key]
if "packaging" in loaded_pyproject_toml:
result["KEEP_FIELDS"]["packaging"] = loaded_pyproject_toml["packaging"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ exclude = [
[tool.setuptools.package-data]
pytyped = ["py.typed"]
{% endif %}
{% if KEEP_FIELDS and KEEP_FIELDS.get('tool.azure-sdk-build') %}
{% if KEEP_FIELDS %}
{% for field_key, field_val in KEEP_FIELDS.items() %}
{% if field_key.startswith('tool.azure-sdk') %}

[tool.azure-sdk-build]
{% for key, val in KEEP_FIELDS.get('tool.azure-sdk-build').items() %}
[{{ field_key }}]
{% for key, val in field_val.items() %}
{{ key }} = {{ val|tojson }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if KEEP_FIELDS and KEEP_FIELDS.get('packaging') %}

[packaging]
Expand Down
Loading