Fixing mypy and ruff errors.
This commit is contained in:
@@ -7,7 +7,7 @@ readme = "README.md"
|
|||||||
packages = [{include = "src"}]
|
packages = [{include = "src"}]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.12.3"
|
python = "^3.12"
|
||||||
flask = "^3.0"
|
flask = "^3.0"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
@@ -49,7 +49,7 @@ known-first-party = ["src"]
|
|||||||
|
|
||||||
# ── Mypy ───────────────────────────────────────────────────────────────────
|
# ── Mypy ───────────────────────────────────────────────────────────────────
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
python_version = "3.12.3"
|
python_version = "3.12"
|
||||||
strict = true
|
strict = true
|
||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unused_configs = true
|
warn_unused_configs = true
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
from flask import Flask, jsonify
|
from datetime import UTC, datetime
|
||||||
from datetime import datetime, timezone
|
|
||||||
|
from flask import Flask, Response, jsonify
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/heartbeat")
|
@app.get("/heartbeat")
|
||||||
def heartbeat() -> tuple:
|
def heartbeat() -> tuple[Response, int]:
|
||||||
return (
|
return (
|
||||||
jsonify(
|
jsonify(
|
||||||
{
|
{
|
||||||
"status": "ok",
|
"status": "ok",
|
||||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
"timestamp": datetime.now(UTC).isoformat(),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
200,
|
200,
|
||||||
|
|||||||
Reference in New Issue
Block a user