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
18 changes: 13 additions & 5 deletions advanced_alchemy/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,22 @@ def encode_json(data: Any) -> str: # pragma: no cover

except ImportError:
try:
from orjson import OPT_NAIVE_UTC, OPT_SERIALIZE_NUMPY, OPT_SERIALIZE_UUID
from orjson import dumps as _encode_json
from orjson import loads as decode_json # type: ignore[no-redef,assignment]
from orjson import ( # type: ignore[import-not-found] # pyright: ignore[reportMissingImports]
OPT_NAIVE_UTC, # pyright: ignore[reportUnknownVariableType]
OPT_SERIALIZE_NUMPY, # pyright: ignore[reportUnknownVariableType]
OPT_SERIALIZE_UUID, # pyright: ignore[reportUnknownVariableType]
)
from orjson import ( # type: ignore[import-not-found] # pyright: ignore[reportMissingImports]
dumps as _encode_json, # pyright: ignore[reportUnknownVariableType]
)
from orjson import ( # type: ignore[no-redef,assignment,import-not-found] # pyright: ignore[reportMissingImports]
loads as decode_json, # pyright: ignore[reportUnknownVariableType,reportUnusedImport]
)

def encode_json(data: Any) -> str: # pragma: no cover
return _encode_json(
return _encode_json( # type: ignore[no-any-return]
data, default=_type_to_string, option=OPT_SERIALIZE_NUMPY | OPT_NAIVE_UTC | OPT_SERIALIZE_UUID
).decode("utf-8") # type: ignore[no-any-return]
).decode("utf-8")

except ImportError:
from json import dumps as encode_json # type: ignore[assignment] # noqa: F401
Expand Down
11 changes: 4 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ maintainers = [
name = "advanced_alchemy"
readme = "docs/PYPI_README.md"
requires-python = ">=3.9"
version = "1.9.0"
version = "1.9.0b1"

[project.urls]
Changelog = "https://advanced-alchemy.litestar.dev/latest/changelog"
Expand Down Expand Up @@ -176,7 +176,7 @@ test = [
allow_dirty = true
commit = false
commit_args = "--no-verify"
current_version = "1.9.0"
current_version = "1.9.0b1"
ignore_missing_files = false
ignore_missing_version = false
message = "chore(release): bump to v{new_version}"
Expand All @@ -187,18 +187,15 @@ parse = """(?x)
regex = false
replace = "{new_version}"
search = "{current_version}"
serialize = [
"{major}.{minor}.{patch}{pre}{pre_n}",
"{major}.{minor}.{patch}",
]
serialize = ["{major}.{minor}.{patch}{pre}{pre_n}", "{major}.{minor}.{patch}"]
sign_tags = false
tag = false
tag_message = "chore(release): v{new_version}"
tag_name = "v{new_version}"

[tool.bumpversion.parts.pre]
optional_value = "stable"
first_value = "stable"
optional_value = "stable"
values = ["a", "b", "rc", "stable"]

[tool.bumpversion.parts.pre_n]
Expand Down
Loading
Loading