schemez 1.2.3__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of schemez might be problematic. Click here for more details.

Files changed (25) hide show
  1. {schemez-1.2.3 → schemez-1.2.4}/PKG-INFO +1 -1
  2. {schemez-1.2.3 → schemez-1.2.4}/pyproject.toml +1 -1
  3. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/functionschema.py +2 -2
  4. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/helpers.py +0 -2
  5. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/schema.py +5 -4
  6. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/tool_executor/executor.py +7 -6
  7. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/tool_executor/helpers.py +2 -2
  8. {schemez-1.2.3 → schemez-1.2.4}/LICENSE +0 -0
  9. {schemez-1.2.3 → schemez-1.2.4}/README.md +0 -0
  10. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/__init__.py +0 -0
  11. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/bind_kwargs.py +0 -0
  12. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/code.py +0 -0
  13. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/convert.py +0 -0
  14. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/create_type.py +0 -0
  15. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/docstrings.py +0 -0
  16. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/executable.py +0 -0
  17. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/log.py +0 -0
  18. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/py.typed +0 -0
  19. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/pydantic_types.py +0 -0
  20. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/schema_generators.py +0 -0
  21. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/schemadef/__init__.py +0 -0
  22. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/schemadef/schemadef.py +0 -0
  23. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/tool_executor/__init__.py +0 -0
  24. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/tool_executor/types.py +0 -0
  25. {schemez-1.2.3 → schemez-1.2.4}/src/schemez/typedefs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: schemez
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: Pydantic shim for config stuff
5
5
  Keywords:
6
6
  Author: Philipp Temminghoff
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "schemez"
3
- version = "1.2.3"
3
+ version = "1.2.4"
4
4
  description = "Pydantic shim for config stuff"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -12,7 +12,6 @@ import decimal
12
12
  import enum
13
13
  import inspect
14
14
  import ipaddress
15
- import logging
16
15
  from pathlib import Path
17
16
  import re
18
17
  import types
@@ -23,6 +22,7 @@ from uuid import UUID
23
22
  import docstring_parser
24
23
  import pydantic
25
24
 
25
+ from schemez import log
26
26
  from schemez.typedefs import (
27
27
  OpenAIFunctionDefinition,
28
28
  OpenAIFunctionTool,
@@ -34,7 +34,7 @@ if typing.TYPE_CHECKING:
34
34
  from schemez.typedefs import Property
35
35
 
36
36
 
37
- logger = logging.getLogger(__name__)
37
+ logger = log.get_logger(__name__)
38
38
 
39
39
 
40
40
  class FunctionType(enum.StrEnum):
@@ -4,7 +4,6 @@ from __future__ import annotations
4
4
 
5
5
  import asyncio
6
6
  import importlib
7
- import os
8
7
  from pathlib import Path
9
8
  import shutil
10
9
  import subprocess
@@ -16,7 +15,6 @@ from pydantic import BaseModel
16
15
  from pydantic_core import to_json
17
16
 
18
17
 
19
- StrPath = str | os.PathLike[str]
20
18
  PythonVersion = Literal["3.13", "3.14", "3.15"]
21
19
 
22
20
  if TYPE_CHECKING:
@@ -2,7 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import os
6
5
  from typing import TYPE_CHECKING, Any, Literal, Self
7
6
 
8
7
  import anyenv
@@ -15,9 +14,9 @@ if TYPE_CHECKING:
15
14
 
16
15
  from llmling_agent.agent.agent import AgentType
17
16
  from llmling_agent.models.content import BaseContent
17
+ from upath.types import JoinablePathLike
18
18
 
19
19
 
20
- StrPath = str | os.PathLike[str]
21
20
  SourceType = Literal["pdf", "image"]
22
21
  PythonVersion = Literal["3.13", "3.14", "3.15"]
23
22
 
@@ -43,7 +42,9 @@ class Schema(BaseModel):
43
42
  return merge_models(self, other)
44
43
 
45
44
  @classmethod
46
- def from_yaml(cls, content: str, inherit_path: StrPath | None = None) -> Self:
45
+ def from_yaml(
46
+ cls, content: str, inherit_path: JoinablePathLike | None = None
47
+ ) -> Self:
47
48
  """Create from YAML string."""
48
49
  import yamling
49
50
 
@@ -233,7 +234,7 @@ class Schema(BaseModel):
233
234
  )
234
235
  return yamling.dump_yaml(text)
235
236
 
236
- def save(self, path: StrPath, overwrite: bool = False) -> None:
237
+ def save(self, path: JoinablePathLike, overwrite: bool = False) -> None:
237
238
  """Save configuration to a YAML file.
238
239
 
239
240
  Args:
@@ -3,7 +3,6 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import asyncio
6
- import logging
7
6
  from pathlib import Path
8
7
  import time
9
8
  from typing import TYPE_CHECKING, Any
@@ -12,6 +11,7 @@ from pydantic import BaseModel
12
11
  from pydantic_core import from_json
13
12
  from upath import UPath
14
13
 
14
+ from schemez import log
15
15
  from schemez.functionschema import FunctionSchema
16
16
  from schemez.tool_executor.helpers import clean_generated_code, generate_input_model
17
17
 
@@ -20,11 +20,12 @@ if TYPE_CHECKING:
20
20
  from collections.abc import Callable, Sequence
21
21
 
22
22
  from fastapi import FastAPI
23
+ from upath.types import JoinablePathLike
23
24
 
24
25
  from schemez.tool_executor.types import ToolHandler
25
26
 
26
27
 
27
- logger = logging.getLogger(__name__)
28
+ logger = log.get_logger(__name__)
28
29
 
29
30
 
30
31
  class HttpToolExecutor:
@@ -32,7 +33,7 @@ class HttpToolExecutor:
32
33
 
33
34
  def __init__(
34
35
  self,
35
- schemas: Sequence[dict[str, Any] | Path],
36
+ schemas: Sequence[dict[str, Any] | UPath],
36
37
  handler: ToolHandler,
37
38
  base_url: str = "http://localhost:8000",
38
39
  ):
@@ -61,7 +62,7 @@ class HttpToolExecutor:
61
62
  match schema:
62
63
  case dict():
63
64
  loaded_schemas.append(schema)
64
- case str() | Path():
65
+ case str() | Path() | UPath():
65
66
  text = UPath(schema).read_text("utf-8")
66
67
  loaded_schemas.append(from_json(text))
67
68
  case _:
@@ -264,7 +265,7 @@ from datetime import datetime
264
265
  uvicorn.run(app, host=host, port=port)
265
266
  return None
266
267
 
267
- async def save_to_files(self, output_dir: Path) -> dict[str, Path]:
268
+ async def save_to_files(self, output_dir: JoinablePathLike) -> dict[str, UPath]:
268
269
  """Save generated code to files.
269
270
 
270
271
  Args:
@@ -273,7 +274,7 @@ from datetime import datetime
273
274
  Returns:
274
275
  Dictionary mapping file types to paths
275
276
  """
276
- output_dir = Path(output_dir)
277
+ output_dir = UPath(output_dir)
277
278
  output_dir.mkdir(parents=True, exist_ok=True)
278
279
 
279
280
  saved_files = {}
@@ -2,13 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import logging
6
5
  import time
7
6
 
7
+ from schemez import log
8
8
  from schemez.helpers import model_to_python_code
9
9
 
10
10
 
11
- logger = logging.getLogger(__name__)
11
+ logger = log.get_logger(__name__)
12
12
 
13
13
 
14
14
  async def generate_input_model(schema_dict: dict) -> tuple[str, str]:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes