lagom
lagom copied to clipboard
📦 Autowiring dependency injection container for python 3
Can give a speed boost
The TLDR goal of this work is to be able to build [@strawberry](https://github.com/strawberry-graphql/strawberry) data loaders like this: ```python class AuthorLoader(DataLoader[str, Author]): def __init__(self, some_dep_db: DB): super().__init__(self.get_authors) self.db = some_dep_db async...
Lagom allows (and should encourage) containers to be stacked on top of each other. This is especially useful when you have different contexts like a web app and a worker...
Hi Steve, I really love using lagom. However, it seems that we cannot register/resolve async context managesr in the same way we can with context managers and ContextContainer. For example,...
Error when inject async function: ```python /cache/asdf/installs/python/3.8.11/lib/python3.8/unittest/mock.py:1322: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _...
On (at least) 3.7.2 it produces the following error: ``` ============================================================ FAILURES ============================================================= ___________________________________________ test_an_async_bound_function_can_be_mocked ____________________________________________ @mock.patch("tests.bug_fixes.resources_for_189.an_async_bound_function", _fake_async) @pytest.mark.asyncio async def test_an_async_bound_function_can_be_mocked(): from tests.bug_fixes.resources_for_189 import an_async_bound_function from tests.test_context_based_executions import SomeDep...
Discussion on #189 made me realise this is a valuable thing to document.