Remove dill dependency
This commit is contained in:
parent
774263d0ae
commit
112c01afa8
@ -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"
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user