diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae6b219..cc7de0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.283 + rev: v0.0.284 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/docs/index.md b/docs/index.md index b9a0bcb..267e526 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,9 +25,7 @@ Read on in *{doc}`why`*, if you find that intriguing! why core-concepts -flask -pyramid -custom +integrations/index typing-caveats glossary security diff --git a/docs/custom.md b/docs/integrations/custom.md similarity index 92% rename from docs/custom.md rename to docs/integrations/custom.md index a141b1a..c7b2a67 100644 --- a/docs/custom.md +++ b/docs/integrations/custom.md @@ -1,6 +1,6 @@ -# Custom Integrations +# Write Your Own! -Once you've understood how registries and containers interact (see {doc}`core-concepts` if not), you already know how to write your own integrations! +Once you've understood how registries and containers interact (see {doc}`../core-concepts` if not), you already know how to write your own integrations! All you need to do is: diff --git a/docs/flask.md b/docs/integrations/flask.md similarity index 99% rename from docs/flask.md rename to docs/integrations/flask.md index 913ce22..44a868a 100644 --- a/docs/flask.md +++ b/docs/integrations/flask.md @@ -102,7 +102,7 @@ def index() -> flask.ResponseValue: The {func}`svcs.flask.get_pings` helper will transparently pick the container from `g`. So, if you would like a [health endpoint](https://kubernetes.io/docs/reference/using-api/health-checks/), it could look like this: -```{literalinclude} examples/health_check_flask.py +```{literalinclude} ../examples/health_check_flask.py ``` (flask-testing)= diff --git a/docs/integrations/index.md b/docs/integrations/index.md new file mode 100644 index 0000000..56a095c --- /dev/null +++ b/docs/integrations/index.md @@ -0,0 +1,12 @@ +# Integrations + +Framework integrations are the main way to use *svcs*. +Here's documentation on those we ship and how you can write your own. + +```{toctree} +:maxdepth: 2 + +flask +pyramid +custom +``` diff --git a/docs/pyramid.md b/docs/integrations/pyramid.md similarity index 100% rename from docs/pyramid.md rename to docs/integrations/pyramid.md diff --git a/docs/why.md b/docs/why.md index 61b23c1..7b19075 100644 --- a/docs/why.md +++ b/docs/why.md @@ -127,8 +127,8 @@ If you're still interested, learn about our [core concepts](core-concepts) first Once you've understood the life cycles of registries and containers, you can look our framework integrations that get you started in no time: -- [Flask](flask.md) -- [Pyramid](pyramid.md) -- Or learn to write [your own](custom.md)! +- [Flask](integrations/flask.md) +- [Pyramid](integrations/pyramid.md) +- Or learn to write [your own](integrations/custom.md)! If you get overwhelmed by the jargon, we have put much effort into our [glossary](glossary)! diff --git a/tests/integrations/__init__.py b/tests/integrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_flask.py b/tests/integrations/test_flask.py similarity index 98% rename from tests/test_flask.py rename to tests/integrations/test_flask.py index c8d30b7..101ac1d 100644 --- a/tests/test_flask.py +++ b/tests/integrations/test_flask.py @@ -8,8 +8,8 @@ import svcs -from .fake_factories import nop -from .ifaces import AnotherService, Interface, Service +from tests.fake_factories import nop +from tests.ifaces import AnotherService, Interface, Service try: diff --git a/tests/test_pyramid.py b/tests/integrations/test_pyramid.py similarity index 95% rename from tests/test_pyramid.py rename to tests/integrations/test_pyramid.py index 9779d99..8333177 100644 --- a/tests/test_pyramid.py +++ b/tests/integrations/test_pyramid.py @@ -4,8 +4,8 @@ import svcs -from .fake_factories import int_factory -from .ifaces import AnotherService, Service +from tests.fake_factories import int_factory +from tests.ifaces import AnotherService, Service try: diff --git a/tox.ini b/tox.ini index 306f757..38cc3ed 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,11 @@ deps = optional: webtest commands = coverage run -m pytest {posargs} +[testenv:py312-optional] +deps = + coverage[toml] + flask + [testenv:pre-commit] description = Run all pre-commit hooks. @@ -82,7 +87,9 @@ package = editable base_python = {[testenv:docs]base_python} extras = {[testenv:docs]extras} deps = watchfiles +allowlist_externals = rm commands = + rm -rf docs/_build/html watchfiles \ --ignore-paths docs/_build/ \ 'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \