Skip to content

Commit 4f34752

Browse files
committed
fix(ci): added __init__.py files to namespace directories for proper
editable installs
1 parent 375f69f commit 4f34752

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Namespace package for myfy
2+
# See PEP 420 - Implicit Namespace Packages
3+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Namespace package for myfy
2+
# See PEP 420 - Implicit Namespace Packages
3+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

packages/myfy-web/myfy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Namespace package for myfy
2+
# See PEP 420 - Implicit Namespace Packages
3+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

packages/myfy-web/myfy/web/handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ async def _parse_body(self, request: Request, body_type: type) -> Any:
155155
# Type checker doesn't know about Pydantic's model_validate
156156
return body_type.model_validate(data) # type: ignore[attr-defined]
157157
except ValidationError as e:
158-
raise HTTPException(
159-
status_code=422, detail={"errors": e.errors(), "body": data}
160-
) from e
158+
# Convert validation errors to string for HTTPException
159+
error_detail = json.dumps({"errors": e.errors(), "body": data})
160+
raise HTTPException(status_code=422, detail=error_detail) from e
161161
elif hasattr(body_type, "__dataclass_fields__"):
162162
# Dataclass
163163
try:

0 commit comments

Comments
 (0)