Skip to content

Commit 17be5f9

Browse files
committed
Update fastapi-sqlalchemy example
1 parent 485d6e7 commit 17be5f9

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

examples/miniapps/fastapi-sqlalchemy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-buster
1+
FROM python:3.10-buster
22

33
ENV PYTHONUNBUFFERED=1
44
ENV HOST=0.0.0.0

examples/miniapps/fastapi-sqlalchemy/README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,24 @@ The output should be something like:
7373

7474
.. code-block::
7575
76-
platform linux -- Python 3.9.1, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
76+
platform linux -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
7777
rootdir: /code
78-
plugins: cov-2.11.1
78+
plugins: cov-3.0.0
7979
collected 7 items
8080
8181
webapp/tests.py ....... [100%]
8282
83-
----------- coverage: platform linux, python 3.9.1-final-0 -----------
83+
---------- coverage: platform linux, python 3.10.0-final-0 ----------
8484
Name Stmts Miss Cover
8585
--------------------------------------------
8686
webapp/__init__.py 0 0 100%
87-
webapp/application.py 14 0 100%
88-
webapp/containers.py 9 0 100%
87+
webapp/application.py 12 0 100%
88+
webapp/containers.py 10 0 100%
8989
webapp/database.py 24 8 67%
9090
webapp/endpoints.py 32 0 100%
9191
webapp/models.py 10 1 90%
9292
webapp/repositories.py 36 20 44%
9393
webapp/services.py 16 0 100%
9494
webapp/tests.py 59 0 100%
9595
--------------------------------------------
96-
TOTAL 200 29 86%
96+
TOTAL 199 29 85%

examples/miniapps/fastapi-sqlalchemy/webapp/application.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
def create_app() -> FastAPI:
1010
container = Container()
11-
container.config.from_yaml("config.yml")
12-
container.wire(modules=[endpoints])
1311

1412
db = container.db()
1513
db.create_database()

examples/miniapps/fastapi-sqlalchemy/webapp/containers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
class Container(containers.DeclarativeContainer):
1111

12-
config = providers.Configuration()
12+
wiring_config = containers.WiringConfiguration(modules=[".endpoints"])
13+
14+
config = providers.Configuration(yaml_files=["config.yml"])
1315

1416
db = providers.Singleton(Database, db_url=config.db.url)
1517

0 commit comments

Comments
 (0)