Remove dill dependency

This commit is contained in:
Masen Furer 2024-10-03 17:13:49 -07:00
parent 774263d0ae
commit 112c01afa8
No known key found for this signature in database
GPG Key ID: B0008AD22B3B3A95
2 changed files with 0 additions and 21 deletions

View File

@ -27,7 +27,6 @@ packages = [
[tool.poetry.dependencies]
python = "^3.9"
dill = ">=0.3.8,<0.4"
fastapi = ">=0.96.0,!=0.111.0,!=0.111.1"
gunicorn = ">=20.1.0,<24.0"
jinja2 = ">=3.1.2,<4.0"

View File

@ -35,7 +35,6 @@ from typing import (
get_type_hints,
)
import dill
from sqlalchemy.orm import DeclarativeBase
from typing_extensions import Self
@ -2835,25 +2834,6 @@ class StateManagerDisk(StateManager):
await self.set_state(token, state)
# Workaround https://github.com/cloudpipe/cloudpickle/issues/408 for dynamic pydantic classes
if not isinstance(State.validate.__func__, FunctionType):
cython_function_or_method = type(State.validate.__func__)
@dill.register(cython_function_or_method)
def _dill_reduce_cython_function_or_method(pickler, obj):
# Ignore cython function when pickling.
pass
@dill.register(type(State))
def _dill_reduce_state(pickler, obj):
if obj is not State and issubclass(obj, State):
# Avoid serializing subclasses of State, instead get them by reference from the State class.
pickler.save_reduce(State.get_class_substate, (obj.get_full_name(),), obj=obj)
else:
dill.Pickler.dispatch[type](pickler, obj)
def _default_lock_expiration() -> int:
"""Get the default lock expiration time.