Skip to content

Commit

Permalink
Update fastapi-sqlalchemy example
Browse files Browse the repository at this point in the history
  • Loading branch information
rmk135 committed Oct 28, 2021
1 parent 485d6e7 commit 17be5f9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 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
Expand Down
12 changes: 6 additions & 6 deletions examples/miniapps/fastapi-sqlalchemy/README.rst
Expand Up @@ -73,24 +73,24 @@ 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%
webapp/repositories.py 36 20 44%
webapp/services.py 16 0 100%
webapp/tests.py 59 0 100%
--------------------------------------------
TOTAL 200 29 86%
TOTAL 199 29 85%
2 changes: 0 additions & 2 deletions examples/miniapps/fastapi-sqlalchemy/webapp/application.py
Expand Up @@ -8,8 +8,6 @@

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

db = container.db()
db.create_database()
Expand Down
4 changes: 3 additions & 1 deletion examples/miniapps/fastapi-sqlalchemy/webapp/containers.py
Expand Up @@ -9,7 +9,9 @@

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)

Expand Down

0 comments on commit 17be5f9

Please sign in to comment.