langgraph-sdk 0.2.0a1__tar.gz → 0.2.2__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.
@@ -1,7 +1,7 @@
1
- .PHONY: lint format
1
+ .PHONY: lint format test
2
2
 
3
3
  test:
4
- echo "No tests to run"
4
+ uv run pytest tests
5
5
 
6
6
  ######################
7
7
  # LINTING AND FORMATTING
@@ -17,7 +17,7 @@ lint lint_diff:
17
17
  uv run ruff check .
18
18
  [ "$(PYTHON_FILES)" = "" ] || uv run ruff format $(PYTHON_FILES) --diff
19
19
  [ "$(PYTHON_FILES)" = "" ] || uv run ruff check --select I $(PYTHON_FILES)
20
- [ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) || uv run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
20
+ uvx ty check .
21
21
 
22
22
  format format_diff:
23
23
  uv run ruff check --select I --fix $(PYTHON_FILES)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-sdk
3
- Version: 0.2.0a1
3
+ Version: 0.2.2
4
4
  Summary: SDK for interacting with LangGraph API
5
5
  Project-URL: Repository, https://www.github.com/langchain-ai/langgraph
6
6
  License-Expression: MIT
@@ -0,0 +1,6 @@
1
+ from langgraph_sdk.auth import Auth
2
+ from langgraph_sdk.client import get_client, get_sync_client
3
+
4
+ __version__ = "0.2.2"
5
+
6
+ __all__ = ["Auth", "get_client", "get_sync_client"]
@@ -385,6 +385,8 @@ class _ResourceOn(typing.Generic[VCreate, VRead, VUpdate, VDelete, VSearch]):
385
385
  _register_handler(self.auth, self.resource, "*", handler),
386
386
  )
387
387
 
388
+ # Accept keyword-only parameters for future filtering behavior; referenced to satisfy linters.
389
+ _ = resources, actions
388
390
  return decorator
389
391
 
390
392
 
@@ -701,7 +703,7 @@ def _validate_handler(fn: Callable[..., typing.Any]) -> None:
701
703
  """
702
704
  if not inspect.iscoroutinefunction(fn):
703
705
  raise ValueError(
704
- f"Auth handler '{fn.__name__}' must be an async function. "
706
+ f"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. "
705
707
  "Add 'async' before 'def' to make it asynchronous and ensure"
706
708
  " any IO operations are non-blocking."
707
709
  )
@@ -709,18 +711,20 @@ def _validate_handler(fn: Callable[..., typing.Any]) -> None:
709
711
  sig = inspect.signature(fn)
710
712
  if "ctx" not in sig.parameters:
711
713
  raise ValueError(
712
- f"Auth handler '{fn.__name__}' must have a 'ctx: AuthContext' parameter. "
714
+ f"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. "
713
715
  "Update the function signature to include this required parameter."
714
716
  )
715
717
  if "value" not in sig.parameters:
716
718
  raise ValueError(
717
- f"Auth handler '{fn.__name__}' must have a 'value' parameter. "
719
+ f"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'value' parameter. "
718
720
  " The value contains the mutable data being sent to the endpoint."
719
721
  "Update the function signature to include this required parameter."
720
722
  )
721
723
 
722
724
 
723
- def is_studio_user(user: types.MinimalUser | types.User | types.UserDict) -> bool:
725
+ def is_studio_user(
726
+ user: types.MinimalUser | types.BaseUser | types.MinimalUserDict,
727
+ ) -> bool:
724
728
  return (
725
729
  isinstance(user, types.StudioUser)
726
730
  or isinstance(user, dict)