diff --git a/.circleci/config.yml b/.circleci/config.yml index 7445c8a..0dc3321 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: lint: docker: &py38 - - image: playpauseandstop/docker-python:3.0.0b0-py38 + - image: playpauseandstop/docker-python:3.0.0-py38 steps: - checkout - run: make install @@ -10,7 +10,7 @@ jobs: test36: docker: - - image: playpauseandstop/docker-python:3.0.0b0-py36 + - image: playpauseandstop/docker-python:3.0.0-py36 steps: - checkout - run: mkdir -p test-results/pytest @@ -26,7 +26,7 @@ jobs: test37: docker: - - image: playpauseandstop/docker-python:3.0.0b0-py37 + - image: playpauseandstop/docker-python:3.0.0-py37 steps: - checkout - run: mkdir -p test-results/pytest diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5ede10c..a5677ca 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,10 +1,16 @@ 2.0.0 (In Development) ---------------------- +2.0.0b2 (2019-12-19) +-------------------- + +- chore: `setup_openapi` function returns `web.Applicaiton` instead of None +- chore: Provide `ACCESS_LOG_FORMAT` for `aiohttp` applications + 2.0.0b1 (2019-11-20) -------------------- -- fix: Fix type annotation for `add_resource_context` context manage +- fix: Fix type annotation for `add_resource_context` context manager 2.0.0b0 (2019-11-15) -------------------- diff --git a/pyproject.toml b/pyproject.toml index d63760d..a3e9e3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ line_length = 79 [tool.poetry] name = "rororo" -version = "2.0.0b1" +version = "2.0.0b2" description = "OpenAPI 3 schema support for aiohttp.web applications." authors = ["Igor Davydenko "] license = "BSD-3-Clause" diff --git a/rororo/__init__.py b/rororo/__init__.py index d078b50..7a963e0 100644 --- a/rororo/__init__.py +++ b/rororo/__init__.py @@ -33,4 +33,4 @@ __author__ = "Igor Davydenko" __license__ = "BSD-3-Clause" -__version__ = "2.0.0b1" +__version__ = "2.0.0b2" diff --git a/rororo/aio.py b/rororo/aio.py index 2181971..7dc5b69 100644 --- a/rororo/aio.py +++ b/rororo/aio.py @@ -25,6 +25,10 @@ __all__ = ("add_resource_context", "is_xhr_request", "parse_aioredis_url") +#: Default access log format to use within aiohttp applications +ACCESS_LOG_FORMAT = '%a "%r" %s %b "%{Referer}i" "%{User-Agent}i" %Tf' + + class AddResourceFunc(Protocol): def __call__( self, diff --git a/rororo/openapi/openapi.py b/rororo/openapi/openapi.py index e38dac6..9d47931 100644 --- a/rororo/openapi/openapi.py +++ b/rororo/openapi/openapi.py @@ -114,7 +114,7 @@ def setup_openapi( route_prefix: str = None, is_validate_response: bool = False, has_openapi_schema_handler: bool = True, -) -> None: +) -> web.Application: """Setup OpenAPI schema to use with aiohttp.web application. Unlike `aiohttp-apispec `_ and @@ -225,3 +225,5 @@ def read_schema(path: Path) -> DictStrAny: add_prefix("/openapi.{schema_format}", route_prefix), views.openapi_schema, ) + + return app diff --git a/tests/openapi.json b/tests/openapi.json index f4904c0..d47f199 100644 --- a/tests/openapi.json +++ b/tests/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.2", "info": { "title": "rororo", - "version": "2.0.0b1", + "version": "2.0.0b2", "contact": { "name": "Igor Davydenko (developer)", "url": "https://igordavydenko.com", diff --git a/tests/openapi.yaml b/tests/openapi.yaml index afcaf15..1d1d7ee 100644 --- a/tests/openapi.yaml +++ b/tests/openapi.yaml @@ -2,7 +2,7 @@ openapi: "3.0.2" info: title: "rororo" - version: "2.0.0b1" + version: "2.0.0b2" contact: name: "Igor Davydenko (developer)" url: "https://igordavydenko.com"