Skip to content

Commit 433be7e

Browse files
committed
revert utilization of lazy object proxy
1 parent 7840c5a commit 433be7e

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ html5lib = { version = ">=1.0", optional = true }
5454
# https://github.com/apify/crawlee-python/issues/774
5555
httpx = { version = "~=0.27.0", extras = ["brotli", "http2"] }
5656
inquirer = ">=3.3.0"
57-
lazy-object-proxy = ">=1.10.0"
5857
lxml = { version = ">=5.2.0", optional = true }
5958
more_itertools = ">=10.2.0"
6059
parsel = { version = ">=1.9.0", optional = true }

src/crawlee/service_container.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
from lazy_object_proxy import Proxy as LazyObjectProxy
4-
53
from crawlee._utils.docs import docs_group
64
from crawlee.base_storage_client._base_storage_client import BaseStorageClient
75
from crawlee.configuration import Configuration
@@ -93,8 +91,7 @@ def storage_client_was_set(self) -> bool:
9391
@docs_group('Functions')
9492
def get_configuration() -> Configuration:
9593
"""Get the configuration."""
96-
proxy_config: Configuration = LazyObjectProxy(lambda: _service_locator.configuration)
97-
return proxy_config
94+
return _service_locator.configuration
9895

9996

10097
@docs_group('Functions')
@@ -116,8 +113,7 @@ def set_configuration(configuration: Configuration) -> None:
116113
@docs_group('Functions')
117114
def get_event_manager() -> EventManager:
118115
"""Get the event manager."""
119-
proxy_event_manager: EventManager = LazyObjectProxy(lambda: _service_locator.event_manager)
120-
return proxy_event_manager
116+
return _service_locator.event_manager
121117

122118

123119
@docs_group('Functions')
@@ -139,8 +135,7 @@ def set_event_manager(event_manager: EventManager) -> None:
139135
@docs_group('Functions')
140136
def get_storage_client() -> BaseStorageClient:
141137
"""Get the storage client."""
142-
proxy_storage_client: BaseStorageClient = LazyObjectProxy(lambda: _service_locator.storage_client)
143-
return proxy_storage_client
138+
return _service_locator.storage_client
144139

145140

146141
@docs_group('Functions')

0 commit comments

Comments
 (0)