diff --git a/examples/miniapps/fastapi-sqlalchemy/Dockerfile b/examples/miniapps/fastapi-sqlalchemy/Dockerfile index f7c7c1d4..17676624 100644 --- a/examples/miniapps/fastapi-sqlalchemy/Dockerfile +++ b/examples/miniapps/fastapi-sqlalchemy/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-buster +FROM python:3.10-buster ENV PYTHONUNBUFFERED=1 ENV HOST=0.0.0.0 diff --git a/examples/miniapps/fastapi-sqlalchemy/README.rst b/examples/miniapps/fastapi-sqlalchemy/README.rst index 2c8e0b66..688723b9 100644 --- a/examples/miniapps/fastapi-sqlalchemy/README.rst +++ b/examples/miniapps/fastapi-sqlalchemy/README.rst @@ -73,19 +73,19 @@ The output should be something like: .. code-block:: - platform linux -- Python 3.9.1, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 + platform linux -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 rootdir: /code - plugins: cov-2.11.1 + plugins: cov-3.0.0 collected 7 items webapp/tests.py ....... [100%] - ----------- coverage: platform linux, python 3.9.1-final-0 ----------- + ---------- coverage: platform linux, python 3.10.0-final-0 ---------- Name Stmts Miss Cover -------------------------------------------- webapp/__init__.py 0 0 100% - webapp/application.py 14 0 100% - webapp/containers.py 9 0 100% + webapp/application.py 12 0 100% + webapp/containers.py 10 0 100% webapp/database.py 24 8 67% webapp/endpoints.py 32 0 100% webapp/models.py 10 1 90% @@ -93,4 +93,4 @@ The output should be something like: webapp/services.py 16 0 100% webapp/tests.py 59 0 100% -------------------------------------------- - TOTAL 200 29 86% + TOTAL 199 29 85% diff --git a/examples/miniapps/fastapi-sqlalchemy/webapp/application.py b/examples/miniapps/fastapi-sqlalchemy/webapp/application.py index d6aa9eeb..c152ef41 100644 --- a/examples/miniapps/fastapi-sqlalchemy/webapp/application.py +++ b/examples/miniapps/fastapi-sqlalchemy/webapp/application.py @@ -8,8 +8,6 @@ from . import endpoints def create_app() -> FastAPI: container = Container() - container.config.from_yaml("config.yml") - container.wire(modules=[endpoints]) db = container.db() db.create_database() diff --git a/examples/miniapps/fastapi-sqlalchemy/webapp/containers.py b/examples/miniapps/fastapi-sqlalchemy/webapp/containers.py index a5bf81ca..00c6871d 100644 --- a/examples/miniapps/fastapi-sqlalchemy/webapp/containers.py +++ b/examples/miniapps/fastapi-sqlalchemy/webapp/containers.py @@ -9,7 +9,9 @@ from .services import UserService class Container(containers.DeclarativeContainer): - config = providers.Configuration() + wiring_config = containers.WiringConfiguration(modules=[".endpoints"]) + + config = providers.Configuration(yaml_files=["config.yml"]) db = providers.Singleton(Database, db_url=config.db.url)