From 2ce4a1c6b96c14a142f89fac32788f33f3a14d42 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Wed, 27 Oct 2021 21:29:06 -0400 Subject: [PATCH] Update flask-blueprints example --- examples/miniapps/flask-blueprints/README.rst | 27 ++++++++++--------- .../githubnavigator/application.py | 2 -- .../githubnavigator/containers.py | 4 ++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/examples/miniapps/flask-blueprints/README.rst b/examples/miniapps/flask-blueprints/README.rst index 396f7e1e..3d61636c 100644 --- a/examples/miniapps/flask-blueprints/README.rst +++ b/examples/miniapps/flask-blueprints/README.rst @@ -81,20 +81,21 @@ The output should be something like: .. code-block:: - platform darwin -- Python 3.9, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 - plugins: flask-1.0.0, cov-2.10.0 + platform darwin -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 + plugins: cov-3.0.0, flask-1.2.0 collected 2 items githubnavigator/tests.py .. [100%] - ---------- coverage: platform darwin, python 3.9 ----------- - Name Stmts Miss Cover - ---------------------------------------------------- - githubnavigator/__init__.py 0 0 100% - githubnavigator/application.py 15 0 100% - githubnavigator/blueprints/example.py 12 0 100% - githubnavigator/containers.py 7 0 100% - githubnavigator/services.py 14 0 100% - githubnavigator/tests.py 34 0 100% - ----------------------------------------------------------- - TOTAL 82 0 100% + ---------- coverage: platform darwin, python 3.10.0-final-0 ---------- + Name Stmts Miss Cover + ------------------------------------------------------------ + githubnavigator/__init__.py 0 0 100% + githubnavigator/application.py 13 0 100% + githubnavigator/blueprints/__init__.py 0 0 100% + githubnavigator/blueprints/example.py 12 0 100% + githubnavigator/containers.py 8 0 100% + githubnavigator/services.py 14 0 100% + githubnavigator/tests.py 34 0 100% + ------------------------------------------------------------ + TOTAL 81 0 100% diff --git a/examples/miniapps/flask-blueprints/githubnavigator/application.py b/examples/miniapps/flask-blueprints/githubnavigator/application.py index 32aa0667..4b1ae03b 100644 --- a/examples/miniapps/flask-blueprints/githubnavigator/application.py +++ b/examples/miniapps/flask-blueprints/githubnavigator/application.py @@ -9,9 +9,7 @@ from .blueprints import example def create_app() -> Flask: container = Container() - container.config.from_yaml("config.yml") container.config.github.auth_token.from_env("GITHUB_TOKEN") - container.wire(modules=[example]) app = Flask(__name__) app.container = container diff --git a/examples/miniapps/flask-blueprints/githubnavigator/containers.py b/examples/miniapps/flask-blueprints/githubnavigator/containers.py index d2a0e7ca..a0df28ea 100644 --- a/examples/miniapps/flask-blueprints/githubnavigator/containers.py +++ b/examples/miniapps/flask-blueprints/githubnavigator/containers.py @@ -8,7 +8,9 @@ from . import services class Container(containers.DeclarativeContainer): - config = providers.Configuration() + wiring_config = containers.WiringConfiguration(packages=[".blueprints"]) + + config = providers.Configuration(yaml_files=["config.yml"]) github_client = providers.Factory( Github,