Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Flask: Fix: Update setup.py to match requirements.txt #4205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ VERSION = "{{packageVersion}}"
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.0.0",
"swagger-ui-bundle==0.0.2",
"python_dateutil==2.6.0"{{#supportPython2}},
"typing==3.5.2.2"{{/supportPython2}}
"connexion>=2.0.2",
"swagger-ui-bundle>=0.0.2",
"python_dateutil>=2.6.0"{{#supportPython2}},
"typing>=3.5.2.2"{{/supportPython2}}
]

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0-SNAPSHOT
4.2.0-SNAPSHOT
14 changes: 10 additions & 4 deletions samples/openapi3/server/petstore/python-flask-python2/git_push.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"

git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4

if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi

if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
Expand Down Expand Up @@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined

if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi

fi

git pull origin master

# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ def find_pets_by_status(status): # noqa: E501
return 'do some magic!'


def find_pets_by_tags(tags, max_count=None): # noqa: E501
def find_pets_by_tags(tags): # noqa: E501
"""Finds Pets by tags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501

:param tags: Tags to filter by
:type tags: List[str]
:param max_count: Maximum number of items to return
:type max_count: int

:rtype: List[Pet]
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ paths:
type: string
type: array
style: form
- description: Maximum number of items to return
explode: true
in: query
name: maxCount
required: false
schema:
format: int32
type: integer
style: form
responses:
200:
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def test_find_pets_by_tags(self):

Finds Pets by tags
"""
query_string = [('tags', 'tags_example'),
('maxCount', 56)]
query_string = [('tags', 'tags_example')]
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _deserialize(data, klass):
if data is None:
return None

if klass in six.integer_types or klass in (float, str, bool):
if klass in six.integer_types or klass in (float, str, bool, bytearray):
return _deserialize_primitive(data, klass)
elif klass == object:
return _deserialize_object(data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.0.0",
"swagger-ui-bundle==0.0.2",
"python_dateutil==2.6.0",
"typing==3.5.2.2"
"connexion>=2.0.2",
"swagger-ui-bundle>=0.0.2",
"python_dateutil>=2.6.0",
"typing>=3.5.2.2"
]

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0-SNAPSHOT
4.2.0-SNAPSHOT
14 changes: 10 additions & 4 deletions samples/openapi3/server/petstore/python-flask/git_push.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"

git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4

if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi

if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
Expand Down Expand Up @@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined

if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi

fi

git pull origin master

# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

6 changes: 3 additions & 3 deletions samples/openapi3/server/petstore/python-flask/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.0.0",
"swagger-ui-bundle==0.0.2",
"python_dateutil==2.6.0"
"connexion>=2.0.2",
"swagger-ui-bundle>=0.0.2",
"python_dateutil>=2.6.0"
]

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0-SNAPSHOT
4.2.0-SNAPSHOT
14 changes: 10 additions & 4 deletions samples/server/petstore/python-flask-python2/git_push.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"

git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4

if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi

if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
Expand Down Expand Up @@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined

if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi

fi

git pull origin master

# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _deserialize(data, klass):
if data is None:
return None

if klass in six.integer_types or klass in (float, str, bool):
if klass in six.integer_types or klass in (float, str, bool, bytearray):
return _deserialize_primitive(data, klass)
elif klass == object:
return _deserialize_object(data)
Expand Down
8 changes: 4 additions & 4 deletions samples/server/petstore/python-flask-python2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.0.0",
"swagger-ui-bundle==0.0.2",
"python_dateutil==2.6.0",
"typing==3.5.2.2"
"connexion>=2.0.2",
"swagger-ui-bundle>=0.0.2",
"python_dateutil>=2.6.0",
"typing>=3.5.2.2"
]

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0-SNAPSHOT
4.2.0-SNAPSHOT
14 changes: 10 additions & 4 deletions samples/server/petstore/python-flask/git_push.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"

git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4

if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi

if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
Expand Down Expand Up @@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined

if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi

fi

git pull origin master

# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

6 changes: 3 additions & 3 deletions samples/server/petstore/python-flask/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"connexion==2.0.0",
"swagger-ui-bundle==0.0.2",
"python_dateutil==2.6.0"
"connexion>=2.0.2",
"swagger-ui-bundle>=0.0.2",
"python_dateutil>=2.6.0"
]

setup(
Expand Down