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
10 changes: 0 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,3 @@ repos:
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
- types-PyYAML
- types-redis
args: [--strict]
pass_filenames: false
entry: mypy src/
7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ dev-dependencies = [
"pytest-asyncio>=0.24",
"pytest-cov>=6.0",
"ruff>=0.8",
"mypy>=1.13",
"pre-commit>=4.0",
"redis>=7.1.0",
"mcp[cli]>=1.24.0",
Expand All @@ -99,12 +98,6 @@ python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-n auto --dist loadgroup"

[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
disallow_untyped_defs = true

[tool.ruff]
target-version = "py312"
line-length = 100
Expand Down
2 changes: 1 addition & 1 deletion src/py_code_mode/artifacts/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def save(
data_type = "bytes" if isinstance(data, bytes) else "text"
if isinstance(data, bytes):
file_path.write_bytes(data)
elif isinstance(data, (dict, list)):
elif isinstance(data, dict | list):
file_path.write_text(json.dumps(data, indent=2))
data_type = "json"
else:
Expand Down
4 changes: 2 additions & 2 deletions src/py_code_mode/artifacts/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def save(
data_type = "bytes" if isinstance(data, bytes) else "text"
if isinstance(data, bytes):
self._redis.set(data_key, data)
elif isinstance(data, (dict, list)):
elif isinstance(data, dict | list):
self._redis.set(data_key, json.dumps(data))
data_type = "json"
else:
Expand Down Expand Up @@ -117,7 +117,7 @@ def load(self, name: str) -> Any:
data_type = None
try:
entry_json = self._redis.hget(self._index_key(), name)
if entry_json and isinstance(entry_json, (str, bytes)):
if entry_json and isinstance(entry_json, str | bytes):
entry = json.loads(entry_json)
data_type = entry.get("metadata", {}).get("_data_type")
except (json.JSONDecodeError, TypeError):
Expand Down
4 changes: 2 additions & 2 deletions src/py_code_mode/execution/container/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ def serialize_value(value: Any) -> Any:
"""
if value is None:
return None
if isinstance(value, (str, int, float, bool)):
if isinstance(value, str | int | float | bool):
return value
if isinstance(value, dict):
return {k: serialize_value(v) for k, v in value.items()}
if isinstance(value, (list, tuple)):
if isinstance(value, list | tuple):
return [serialize_value(v) for v in value]
if isinstance(value, frozenset):
return list(value)
Expand Down
2 changes: 1 addition & 1 deletion src/py_code_mode/execution/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def validate_storage_not_access(storage: Any, executor_name: str) -> None:
Raises:
TypeError: If storage is a StorageAccess type (old API)
"""
if isinstance(storage, (FileStorageAccess, RedisStorageAccess)):
if isinstance(storage, FileStorageAccess | RedisStorageAccess):
raise TypeError(
f"{executor_name}.start() accepts StorageBackend, not {type(storage).__name__}. "
"Pass the storage backend directly."
Expand Down
2 changes: 0 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading