Skip to content

Commit 156d14b

Browse files
committed
Make flask work with api-spec
1 parent ee8fb34 commit 156d14b

File tree

4 files changed

+222
-12
lines changed

4 files changed

+222
-12
lines changed

.bumpversion.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ post_commit_hooks = []
2323

2424
[[tool.bumpversion.files]]
2525
filename = "my_project_template/__init__.py"
26-
search = "__version__ = \"{current_version}\""
26+
search = "__version__ = \"{current_version}\""
2727
replace = "__version__ = \"{new_version}\""
2828

2929
[[tool.bumpversion.files]]
3030
filename = "pyproject.toml"
31-
search = "version = \"{current_version}\""
31+
search = "version = \"{current_version}\""
3232
replace = "version = \"{new_version}\""
33+
34+
[[tool.bumpversion.files]]
35+
filename = "api-spec.yaml"
36+
search = "version: {current_version}"
37+
replace = "version: {new_version}"

app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
app = connexion.App(__name__)
77
application = app.app
8-
api = app.add_api("api-spec.yaml")
8+
app.add_api("api-spec.yaml")
99

1010

1111
@app.route("/")
1212
def index():
13-
return redirect(api.base_path + "/ui")
13+
return redirect("/ui")
1414

1515

1616
if __name__ == "__main__":
17-
app.run(port=8080, debug=True)
17+
app.run(port=8080)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name = "nmdp-python-project-template"
33
version = "0.0.1"
44
description="Python Project Template. Standardized Python project structure for NMDP projects"
55
requires-python = ">=3.13"
6-
dependencies = []
6+
dependencies = [
7+
]
78
authors = [
89
{name = "Pradeep Bashyal", email = "[email protected]"},
910
{name = "NMDP Person"},
@@ -56,7 +57,7 @@ test = [
5657
]
5758

5859
deploy=[
59-
"connexion[swagger-ui]==3.2.0",
60+
"connexion[swagger-ui,flask,uvicorn]==3.2.0",
6061
"gunicorn==23.0.0"
6162
]
6263

0 commit comments

Comments
 (0)