Compare commits
No commits in common. "v1.12.1-fixed2" and "main" have entirely different histories.
v1.12.1-fi
...
main
@ -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
|
@ -1,5 +1,5 @@
|
||||
from .view import PydanticView
|
||||
|
||||
__version__ = "1.12.1-fixed2"
|
||||
__version__ = "1.12.1"
|
||||
|
||||
__all__ = ("PydanticView", "__version__")
|
||||
|
@ -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")
|
||||
)
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
|
||||
|
8
tasks.py
8
tasks.py
@ -136,7 +136,6 @@ def prepare_ci_env(c):
|
||||
|
||||
title("Installing wheel", "=")
|
||||
package_version = read_configuration("./setup.cfg")["metadata"]["version"]
|
||||
print(Path("dist").glob('*'))
|
||||
dist = next(Path("dist").glob(f"aiohttp_pydantic-{package_version}-*.whl"))
|
||||
c.run(f"dist_venv/bin/python -m pip install {dist}")
|
||||
|
||||
@ -157,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
|
||||
"""
|
||||
@ -166,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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user