Skip to content

Commit 5d7bb17

Browse files
GuillaumeSmahawing328
authored andcommitted
Python: Flask: Fix: Update setup.py to match requirements.txt (#4205)
* Python: Flask: Fix: Update setup.py to match requirements.txt * Regenerate samples python-flask & python-flask-python2
1 parent a38527d commit 5d7bb17

File tree

18 files changed

+66
-54
lines changed

18 files changed

+66
-54
lines changed

modules/openapi-generator/src/main/resources/python-flask/setup.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ VERSION = "{{packageVersion}}"
1414
# http://pypi.python.org/pypi/setuptools
1515

1616
REQUIRES = [
17-
"connexion==2.0.0",
18-
"swagger-ui-bundle==0.0.2",
19-
"python_dateutil==2.6.0"{{#supportPython2}},
20-
"typing==3.5.2.2"{{/supportPython2}}
17+
"connexion>=2.0.2",
18+
"swagger-ui-bundle>=0.0.2",
19+
"python_dateutil>=2.6.0"{{#supportPython2}},
20+
"typing>=3.5.2.2"{{/supportPython2}}
2121
]
2222

2323
setup(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0-SNAPSHOT
1+
4.2.0-SNAPSHOT

samples/openapi3/server/petstore/python-flask-python2/git_push.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="github.com"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="GIT_USER_ID"
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

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

samples/openapi3/server/petstore/python-flask-python2/openapi_server/controllers/pet_controller.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ def find_pets_by_status(status): # noqa: E501
4949
return 'do some magic!'
5050

5151

52-
def find_pets_by_tags(tags, max_count=None): # noqa: E501
52+
def find_pets_by_tags(tags): # noqa: E501
5353
"""Finds Pets by tags
5454
5555
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
5656
5757
:param tags: Tags to filter by
5858
:type tags: List[str]
59-
:param max_count: Maximum number of items to return
60-
:type max_count: int
6159
6260
:rtype: List[Pet]
6361
"""

samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ paths:
115115
type: string
116116
type: array
117117
style: form
118-
- description: Maximum number of items to return
119-
explode: true
120-
in: query
121-
name: maxCount
122-
required: false
123-
schema:
124-
format: int32
125-
type: integer
126-
style: form
127118
responses:
128119
200:
129120
content:

samples/openapi3/server/petstore/python-flask-python2/openapi_server/test/test_pet_controller.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ def test_find_pets_by_tags(self):
8989
9090
Finds Pets by tags
9191
"""
92-
query_string = [('tags', 'tags_example'),
93-
('maxCount', 56)]
92+
query_string = [('tags', 'tags_example')]
9493
headers = {
9594
'Accept': 'application/json',
9695
'Authorization': 'Bearer special-key',

samples/openapi3/server/petstore/python-flask-python2/openapi_server/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _deserialize(data, klass):
1616
if data is None:
1717
return None
1818

19-
if klass in six.integer_types or klass in (float, str, bool):
19+
if klass in six.integer_types or klass in (float, str, bool, bytearray):
2020
return _deserialize_primitive(data, klass)
2121
elif klass == object:
2222
return _deserialize_object(data)

samples/openapi3/server/petstore/python-flask-python2/setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
# http://pypi.python.org/pypi/setuptools
1515

1616
REQUIRES = [
17-
"connexion==2.0.0",
18-
"swagger-ui-bundle==0.0.2",
19-
"python_dateutil==2.6.0",
20-
"typing==3.5.2.2"
17+
"connexion>=2.0.2",
18+
"swagger-ui-bundle>=0.0.2",
19+
"python_dateutil>=2.6.0",
20+
"typing>=3.5.2.2"
2121
]
2222

2323
setup(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0-SNAPSHOT
1+
4.2.0-SNAPSHOT

samples/openapi3/server/petstore/python-flask/git_push.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="github.com"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="GIT_USER_ID"
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

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

samples/openapi3/server/petstore/python-flask/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# http://pypi.python.org/pypi/setuptools
1515

1616
REQUIRES = [
17-
"connexion==2.0.0",
18-
"swagger-ui-bundle==0.0.2",
19-
"python_dateutil==2.6.0"
17+
"connexion>=2.0.2",
18+
"swagger-ui-bundle>=0.0.2",
19+
"python_dateutil>=2.6.0"
2020
]
2121

2222
setup(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0-SNAPSHOT
1+
4.2.0-SNAPSHOT

samples/server/petstore/python-flask-python2/git_push.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="github.com"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="GIT_USER_ID"
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

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

samples/server/petstore/python-flask-python2/openapi_server/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _deserialize(data, klass):
1616
if data is None:
1717
return None
1818

19-
if klass in six.integer_types or klass in (float, str, bool):
19+
if klass in six.integer_types or klass in (float, str, bool, bytearray):
2020
return _deserialize_primitive(data, klass)
2121
elif klass == object:
2222
return _deserialize_object(data)

samples/server/petstore/python-flask-python2/setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
# http://pypi.python.org/pypi/setuptools
1515

1616
REQUIRES = [
17-
"connexion==2.0.0",
18-
"swagger-ui-bundle==0.0.2",
19-
"python_dateutil==2.6.0",
20-
"typing==3.5.2.2"
17+
"connexion>=2.0.2",
18+
"swagger-ui-bundle>=0.0.2",
19+
"python_dateutil>=2.6.0",
20+
"typing>=3.5.2.2"
2121
]
2222

2323
setup(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0-SNAPSHOT
1+
4.2.0-SNAPSHOT

samples/server/petstore/python-flask/git_push.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="github.com"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="GIT_USER_ID"
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

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

samples/server/petstore/python-flask/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# http://pypi.python.org/pypi/setuptools
1515

1616
REQUIRES = [
17-
"connexion==2.0.0",
18-
"swagger-ui-bundle==0.0.2",
19-
"python_dateutil==2.6.0"
17+
"connexion>=2.0.2",
18+
"swagger-ui-bundle>=0.0.2",
19+
"python_dateutil>=2.6.0"
2020
]
2121

2222
setup(

0 commit comments

Comments
 (0)