Skip to content

Commit

Permalink
[Python] rebuild python server samples
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Apr 4, 2020
1 parent 743a618 commit 2f5148b
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
connexion[aiohttp,swagger-ui] == 2.0.2
swagger-ui-bundle == 0.0.2
aiohttp_jinja2 == 1.1.0
connexion[aiohttp,swagger-ui] == 2.6.0
swagger-ui-bundle == 0.0.6
aiohttp_jinja2 == 1.2.0
40 changes: 40 additions & 0 deletions samples/server/petstore/python-aiohttp-srclayout/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding: utf-8

import sys
from setuptools import setup, find_packages

NAME = "openapi_server"
VERSION = "1.0.0"

# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.6.0",
"swagger-ui-bundle==0.0.6",
"aiohttp_jinja2==1.2.0",
]

setup(
name=NAME,
version=VERSION,
description="OpenAPI Petstore",
author_email="",
url="",
keywords=["OpenAPI", "OpenAPI Petstore"],
install_requires=REQUIRES,
packages=find_packages("src/"),
package_dir={"": "src/"},
package_data={'': ['src//openapi/openapi.yaml']},
include_package_data=True,
entry_points={
'console_scripts': ['openapi_server=openapi_server.__main__:main']},
long_description="""\
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
"""
)

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def client(loop, aiohttp_client):
"swagger_ui": True
}
specification_dir = os.path.join(os.path.dirname(__file__), '..',
"src/",
'openapi_server',
'openapi')
app = connexion.AioHttpApp(__name__, specification_dir=specification_dir,
Expand Down
3 changes: 2 additions & 1 deletion samples/server/petstore/python-aiohttp-srclayout/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ skipsdist=True
[testenv]
deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
{toxinidir}

commands=
pytest --cov=src/openapi_server
pytest --cov=src/openapi_server
6 changes: 3 additions & 3 deletions samples/server/petstore/python-aiohttp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
connexion[aiohttp,swagger-ui] == 2.0.2
swagger-ui-bundle == 0.0.2
aiohttp_jinja2 == 1.1.0
connexion[aiohttp,swagger-ui] == 2.6.0
swagger-ui-bundle == 0.0.6
aiohttp_jinja2 == 1.2.0
39 changes: 39 additions & 0 deletions samples/server/petstore/python-aiohttp/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding: utf-8

import sys
from setuptools import setup, find_packages

NAME = "openapi_server"
VERSION = "1.0.0"

# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.6.0",
"swagger-ui-bundle==0.0.6",
"aiohttp_jinja2==1.2.0",
]

setup(
name=NAME,
version=VERSION,
description="OpenAPI Petstore",
author_email="",
url="",
keywords=["OpenAPI", "OpenAPI Petstore"],
install_requires=REQUIRES,
packages=find_packages(),
package_data={'': ['openapi/openapi.yaml']},
include_package_data=True,
entry_points={
'console_scripts': ['openapi_server=openapi_server.__main__:main']},
long_description="""\
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
"""
)

3 changes: 2 additions & 1 deletion samples/server/petstore/python-aiohttp/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ skipsdist=True
[testenv]
deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
{toxinidir}

commands=
pytest --cov=openapi_server
pytest --cov=openapi_server
12 changes: 10 additions & 2 deletions samples/server/petstore/python-flask-python2/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
connexion >= 2.6.0; python_version>="3.6"
connexion >= 2.3.0; python_version=="3.5"
connexion >= 2.3.0; python_version=="3.4"
# connexion 2.6 dropped support for python < 3.6
connexion >= 2.3.0; python_version=="3.5" or python_version=="3.4"
connexion == 2.4.0; python_version<="2.7"
# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug
# we must peg werkzeug versions below to fix connexion
# https://github.com/zalando/connexion/pull/1044
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
typing >= 3.5.2.2
# For specs with timestamps, pyyaml 5.3 broke connexion's spec parsing in python 2.
# Connexion uses copy.deepcopy() on the spec, thus hitting this bug:
# https://github.com/yaml/pyyaml/issues/387
pyyaml < 5.3; python_version<="2.7"
setuptools >= 21.0.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest~=4.6.7 # needed for python 2.7+3.4
pytest-cov>=2.8.1
pytest-randomly==1.2.3 # needed for python 2.7+3.4
flask_testing==0.6.1
Flask-Testing==0.8.0
4 changes: 3 additions & 1 deletion samples/server/petstore/python-flask-python2/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[tox]
envlist = py27, py3
skipsdist=True

[testenv]
deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
{toxinidir}

commands=
pytest --cov=openapi_server
pytest --cov=openapi_server
9 changes: 6 additions & 3 deletions samples/server/petstore/python-flask/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
connexion >= 2.6.0; python_version>="3.6"
connexion >= 2.3.0; python_version=="3.5"
connexion >= 2.3.0; python_version=="3.4"
connexion == 2.4.0; python_version<="2.7"
# connexion 2.6 dropped support for python < 3.6
connexion >= 2.3.0; python_version=="3.5" or python_version=="3.4"
# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug
# we must peg werkzeug versions below to fix connexion
# https://github.com/zalando/connexion/pull/1044
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
setuptools >= 21.0.0
2 changes: 1 addition & 1 deletion samples/server/petstore/python-flask/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest~=4.6.7 # needed for python 2.7+3.4
pytest-cov>=2.8.1
pytest-randomly==1.2.3 # needed for python 2.7+3.4
flask_testing==0.6.1
Flask-Testing==0.8.0
4 changes: 3 additions & 1 deletion samples/server/petstore/python-flask/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[tox]
envlist = py3
skipsdist=True

[testenv]
deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
{toxinidir}

commands=
pytest --cov=openapi_server
pytest --cov=openapi_server

0 comments on commit 2f5148b

Please sign in to comment.