diff --git a/celery-stubs/app/__init__.pyi b/celery-stubs/app/__init__.pyi index 7e9a9e1..d33b745 100644 --- a/celery-stubs/app/__init__.pyi +++ b/celery-stubs/app/__init__.pyi @@ -75,8 +75,8 @@ def shared_task( default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: None = ..., retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -112,8 +112,8 @@ def shared_task( default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: None = ..., retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -149,8 +149,8 @@ def shared_task( default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: type[_T], retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -198,8 +198,8 @@ def shared_task( default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: type[_T], retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., diff --git a/celery-stubs/app/amqp.pyi b/celery-stubs/app/amqp.pyi index 5132f39..7d201de 100644 --- a/celery-stubs/app/amqp.pyi +++ b/celery-stubs/app/amqp.pyi @@ -93,8 +93,8 @@ class AMQP: callbacks: list[Any] | None = None, errbacks: list[Any] | None = None, reply_to: str | None = None, - time_limit: int | None = None, - soft_time_limit: int | None = None, + time_limit: float | None = None, + soft_time_limit: float | None = None, create_sent_event: bool = False, root_id: str | None = None, parent_id: str | None = None, @@ -119,8 +119,8 @@ class AMQP: callbacks: list[Any] | None = None, errbacks: list[Any] | None = None, reply_to: str | None = None, - time_limit: int | None = None, - soft_time_limit: int | None = None, + time_limit: float | None = None, + soft_time_limit: float | None = None, create_sent_event: bool = False, root_id: str | None = None, parent_id: str | None = None, diff --git a/celery-stubs/app/base.pyi b/celery-stubs/app/base.pyi index 8d33db6..456de5c 100644 --- a/celery-stubs/app/base.pyi +++ b/celery-stubs/app/base.pyi @@ -108,11 +108,17 @@ class Celery(Generic[_T_Global]): broker_channel_error_retry: bool = ..., broker_login_method: str = ..., broker_transport_options: dict[str, Any] = ..., - broker_connection_retry_on_startup: bool = ..., - broker_connection_timeout: float = ..., + broker_connection_retry_on_startup: bool | None = ..., + broker_connection_timeout: float | None = ..., + broker_heartbeat: int = ..., + broker_pool_limit: int | None = ..., + result_backend: str | None = ..., result_backend_transport_options: dict[str, Any] | None = ..., result_extended: bool = ..., - result_expires: datetime.timedelta = ..., + result_expires: datetime.timedelta | float | None = ..., + accept_content: list[str] = ..., + enable_utc: bool = ..., + timezone: str | None = ..., beat_schedule: dict[str, Any] | None = ..., task_queues: list[kombu.Queue] | None = ..., task_default_queue: str = ..., @@ -121,16 +127,18 @@ class Celery(Generic[_T_Global]): task_default_routing_key: str = ..., task_default_delivery_mode: str = ..., task_create_missing_queues: bool = ..., + task_always_eager: bool = ..., + task_eager_propagates: bool = ..., task_routes: dict[Any, Any] | Sequence[Any] = ..., task_acks_late: bool = ..., - task_time_limit: int = ..., - task_soft_time_limit: int = ..., + task_time_limit: float | None = ..., + task_soft_time_limit: float | None = ..., task_track_started: bool = ..., task_serializer: str = ..., worker_prefetch_multiplier: int = ..., - worker_max_tasks_per_child: int = ..., - worker_concurrency: int = ..., - worker_max_memory_per_child: int = ..., + worker_max_tasks_per_child: int | None = ..., + worker_concurrency: int | None = ..., + worker_max_memory_per_child: int | None = ..., worker_disable_rate_limits: bool = ..., worker_cancel_long_running_tasks_on_connection_loss: bool = ..., worker_hijack_root_logger: bool = ..., @@ -138,6 +146,7 @@ class Celery(Generic[_T_Global]): worker_task_log_format: str = ..., worker_redirect_stdouts: bool = ..., worker_redirect_stdouts_level: str = ..., + event_queue_expires: float = ..., **kwargs: Any, ) -> None: ... def _task_from_fun( @@ -169,8 +178,8 @@ class Celery(Generic[_T_Global]): send_events: bool = ..., store_errors_even_if_ignored: bool = ..., serializer: str = ..., - time_limit: int | None = ..., - soft_time_limit: int | None = ..., + time_limit: float | None = ..., + soft_time_limit: float | None = ..., autoregister: bool = ..., track_started: bool = ..., acks_late: bool = ..., @@ -207,8 +216,8 @@ class Celery(Generic[_T_Global]): default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: type[_T], retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -247,8 +256,8 @@ class Celery(Generic[_T_Global]): default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: None = ..., retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -287,8 +296,8 @@ class Celery(Generic[_T_Global]): default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: None = ..., retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -327,8 +336,8 @@ class Celery(Generic[_T_Global]): default_retry_delay: int = ..., acks_late: bool = ..., ignore_result: bool = ..., - soft_time_limit: int = ..., - time_limit: int = ..., + soft_time_limit: float | None = ..., + time_limit: float | None = ..., base: type[_T], retry_kwargs: dict[str, Any] = ..., retry_backoff: bool | int = ..., @@ -422,8 +431,8 @@ class Celery(Generic[_T_Global]): retries: int = 0, chord: chord | None = None, reply_to: str | None = None, - time_limit: int | None = None, - soft_time_limit: int | None = None, + time_limit: float | None = None, + soft_time_limit: float | None = None, root_id: str | None = None, parent_id: str | None = None, route_name: str | None = None, diff --git a/celery-stubs/app/task.pyi b/celery-stubs/app/task.pyi index 8bf45ab..ba0a966 100644 --- a/celery-stubs/app/task.pyi +++ b/celery-stubs/app/task.pyi @@ -93,8 +93,8 @@ class Task(Generic[_P, _R_co]): send_events: bool store_errors_even_if_ignored: bool serializer: str - time_limit: int | None - soft_time_limit: int | None + time_limit: float | None + soft_time_limit: float | None autoregister: bool track_started: bool acks_late: bool # None at class level, resolved from config on instances @@ -158,8 +158,8 @@ class Task(Generic[_P, _R_co]): publisher: kombu.Producer = ..., headers: dict[str, str] = ..., ignore_result: bool = ..., - time_limit: int = ..., - soft_time_limit: int = ..., + time_limit: float | None = ..., + soft_time_limit: float | None = ..., ) -> celery.result.AsyncResult[_R_co]: ... def shadow_name( self, args: tuple[Any, ...], kwargs: dict[str, Any], options: dict[str, Any] @@ -202,8 +202,8 @@ class Task(Generic[_P, _R_co]): publisher: kombu.Producer = ..., headers: dict[str, str] = ..., ignore_result: bool = ..., - time_limit: int = ..., - soft_time_limit: int = ..., + time_limit: float | None = ..., + soft_time_limit: float | None = ..., ) -> Retry: ... def apply( self, diff --git a/celery-stubs/app/utils.pyi b/celery-stubs/app/utils.pyi index 15417ef..7a4bab9 100644 --- a/celery-stubs/app/utils.pyi +++ b/celery-stubs/app/utils.pyi @@ -22,13 +22,13 @@ class Settings(ConfigurationView): self, *args: Any, deprecated_settings: set[str] | None = None, **kwargs: Any ) -> None: ... @property - def broker_read_url(self) -> str: ... + def broker_read_url(self) -> str | None: ... @property - def broker_url(self) -> str: ... + def broker_url(self) -> str | None: ... @property - def broker_write_url(self) -> str: ... + def broker_write_url(self) -> str | None: ... @property - def result_backend(self) -> str: ... + def result_backend(self) -> str | None: ... @property def task_default_exchange(self) -> str: ... @property @@ -39,12 +39,10 @@ class Settings(ConfigurationView): def find_option(self, name: str, namespace: str = "") -> tuple[str, Any]: ... def find_value_for_key(self, name: str, namespace: str = "celery") -> Any: ... def get_by_parts(self, *parts: str) -> Any: ... - def humanize( - self, with_defaults: bool = False, censored: bool = True - ) -> dict[str, Any]: ... + def humanize(self, with_defaults: bool = False, censored: bool = True) -> str: ... def maybe_warn_deprecated_settings(self) -> None: ... def table( self, with_defaults: bool = False, censored: bool = True ) -> dict[str, Any]: ... def value_set_for(self, key: str) -> bool: ... - def without_defaults(self) -> dict[str, Any]: ... + def without_defaults(self) -> Settings: ... diff --git a/celery-stubs/contrib/django/task.pyi b/celery-stubs/contrib/django/task.pyi index 6424327..f9aac2e 100644 --- a/celery-stubs/contrib/django/task.pyi +++ b/celery-stubs/contrib/django/task.pyi @@ -41,6 +41,6 @@ class DjangoTask(Task[_P, _R_co]): publisher: kombu.Producer = ..., headers: dict[str, str] = ..., ignore_result: bool = ..., - time_limit: int = ..., - soft_time_limit: int = ..., + time_limit: float | None = ..., + soft_time_limit: float | None = ..., ) -> celery.result.AsyncResult[_R_co]: ...