Skip to content

Commit

Permalink
python SDK(fix): fasthtml correct imports and raise version (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
axelknock committed Feb 27, 2025
1 parent a7df175 commit e18065b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ path = "src/datastar_py/__about__.py"
filename = "src/datastar_py/__about__.py"

[tool.bumpversion]
current_version = "0.4.2"
current_version = "0.4.3"
parse = """(?x)
(?P<major>\\d+)\\.
(?P<minor>\\d+)\\.
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/src/datastar_py/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024-present Felix Ingram <[email protected]>
#
# SPDX-License-Identifier: MIT
__version__ = "0.4.2"
__version__ = "0.4.3"
5 changes: 2 additions & 3 deletions sdk/python/src/datastar_py/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class FastAPIStreamingResponse: ...


try:
from fasthtml.responses import StreamingResponse as FastHTMLStreamingResponse
from fasthtml.xml import to_xml
from fasthtml.starlette import StreamingResponse as FastHTMLStreamingResponse
from fastcore.xml import to_xml
except ImportError:

class FastHTMLStreamingResponse: ...
Expand Down Expand Up @@ -52,7 +52,6 @@ def merge_fragments(cls, fragments, *args, **kwargs):
xml_fragments = [
f if isinstance(f, str) else to_xml(f) for f in fragments
]
# From here, business as usual
return super().merge_fragments(xml_fragments, *args, **kwargs)

super().__init__(generator(XMLServerSentEventGenerator), *args, **kwargs)
Expand Down

0 comments on commit e18065b

Please sign in to comment.