Compare commits

..

No commits in common. "1.12.1-dev4" and "main" have entirely different histories.

6 changed files with 5 additions and 25 deletions

View File

@ -1,11 +0,0 @@
stages:
- package
publish-pypi:
stage: package
image: python:3.8
script:
- pip install -U setuptools wheel pip; pip install invoke
- invoke upload --pypi-user ${PYPI_REPO_USER} --pypi-password ${PYPI_REPO_PASSWORD} --pypi-url ${PYPI_REPO_URL}
only:
- tags

View File

@ -1,5 +1,5 @@
from .view import PydanticView
__version__ = "1.12.1-dev4"
__version__ = "1.12.1"
__all__ = ("PydanticView", "__version__")

View File

@ -15,13 +15,10 @@ def setup(
enable: bool = True,
version_spec: Optional[str] = None,
title_spec: Optional[str] = None,
raise_validation_errors: bool = False,
):
if enable:
oas_app = web.Application()
oas_app["apps to expose"] = tuple(apps_to_expose) or (app,)
for a in oas_app["apps to expose"]:
a['raise_validation_errors'] = raise_validation_errors
oas_app["index template"] = jinja2.Template(
resources.read_text("aiohttp_pydantic.oas", "index.j2")
)

View File

@ -185,8 +185,6 @@ async def oas_ui(request):
static_url = request.app.router["static"].url_for(filename="")
spec_url = request.app.router["spec"].url_for()
if request.scheme != request.headers.get('x-forwarded-proto', request.scheme):
request = request.clone(scheme=request.headers['x-forwarded-proto'])
host = request.url.origin()
return Response(

View File

@ -127,10 +127,7 @@ def inject_params(
else:
injector.inject(self.request, args, kwargs)
except ValidationError as error:
if self.request.app['raise_validation_errors']:
raise
else:
return await self.on_validation_error(error, injector.context)
return await self.on_validation_error(error, injector.context)
return await handler(self, *args, **kwargs)

View File

@ -156,7 +156,7 @@ def prepare_upload(c):
@task(tag_eq_version, prepare_upload)
def upload(c, pypi_user=None, pypi_password=None, pypi_url=None):
def upload(c, pypi_user=None, pypi_password=None):
"""
Upload on pypi
"""
@ -165,9 +165,8 @@ def upload(c, pypi_user=None, pypi_password=None, pypi_url=None):
if pypi_user is not None and pypi_password is not None:
c.run(
f"dist_venv/bin/twine upload --non-interactive"
f" -u {pypi_user} -p {pypi_password} {dist}"
f" --repository-url {pypi_url}",
f" -u {pypi_user} -p {pypi_password} {dist}",
hide=True,
)
else:
c.run(f"dist_venv/bin/twine upload --repository-url {pypi_url} --repository aiohttp-pydantic {dist}")
c.run(f"dist_venv/bin/twine upload --repository aiohttp-pydantic {dist}")