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
7 changes: 7 additions & 0 deletions .chronus/changes/revert-wrong-code-2026-3-29-13-46-47.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Revert wrong code to avoid overwrite customized code when generation-subdir is set
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ def serialize(self) -> None:
# When generation-subdir is configured, generated code goes into a subdirectory
# (e.g., _generated/). We also need an __init__.py in the parent namespace dir
# so that the package is discoverable by find_packages() / pip install.
if self.code_model.options.get("generation-subdir"):
root_dir = self.code_model.get_root_dir()
root_dir = self.code_model.get_root_dir()
if self.code_model.options.get("generation-subdir") and not self.read_file(
root_dir / Path("__init__.py")
):
self.write_file(
root_dir / Path("__init__.py"),
general_serializer.serialize_pkgutil_init_file(),
Expand Down
Loading