Skip to content

Commit

Permalink
More dep updates, mainly to Flask v3
Browse files Browse the repository at this point in the history
  • Loading branch information
le717 committed Jun 6, 2024
1 parent 89c963a commit 5597275
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "API (dev)",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "flask",
"console": "internalConsole",
Expand All @@ -28,7 +28,7 @@
},
{
"name": "API (test)",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "flask",
"console": "internalConsole",
Expand Down
1 change: 1 addition & 0 deletions db/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def run_migrations_online():
In this scenario we need to create an Engine and associate a connection
with the context.
"""

# If you use Alembic revision's --autogenerate flag this function will
# prevent Alembic from creating an empty migration file if nothing changed.
# Source: https://alembic.sqlalchemy.org/en/latest/cookbook.html
Expand Down
1 change: 1 addition & 0 deletions db/versions/7e3df200a38d_remove_rotted_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-10-20 17:16:08.299404
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions db/versions/c41abb284c8f_add_is_dead_is_web_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-10-20 16:38:27.128115
"""

from alembic import op
import sqlalchemy as sa

Expand Down
85 changes: 37 additions & 48 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ authors = ["Caleb <le717@users.noreply.github.com>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.10"
flask = "^2.3.2"
flask-smorest = "^0.40.0"
python = "^3.11"
flask = "^3.0.2"
flask-smorest = "^0.44.0"
sys-vars = "^5.0.0"
gunicorn = "^22.0.0"
sqlalchemy = "^1.4.44"
flask-sqlalchemy = "^3.0.2"
requests = "^2.32.3"
flask-cors = "^4.0.1"
flask-db = "^0.3.2"
flask-db = "^0.4.1"

[tool.poetry.group.dev]

Expand Down
2 changes: 1 addition & 1 deletion secrets/api.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"API_TITLE": "Webring API",
"API_VERSION": "1.1.0",
"API_VERSION": "1.2.1",
"OPENAPI_VERSION": "3.0.2",
"OPENAPI_JSON_PATH": "api-spec.json",
"OPENAPI_URL_PREFIX": "/",
Expand Down
6 changes: 3 additions & 3 deletions src/app_factory.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from importlib import import_module

import sys_vars
from alembic import command
from alembic.config import Config
from flask import Flask
from flask_cors import CORS
from flask_smorest import Api
import sys_vars

from src.core import logger
from src.blueprints import all_blueprints
from src.core import logger
from src.core.database.schema import db


Expand All @@ -23,7 +23,7 @@ def create_app():
app.config.update(sys_vars.get_json("api.json"))

# Don't enable API docs in prod
if app.config["ENV"] == "production":
if sys_vars.get("FLASK_ENV") == "production":
app.config["OPENAPI_URL_PREFIX"] = None

# Enable Discord webhook event logging, falling back to a text log
Expand Down
3 changes: 1 addition & 2 deletions src/core/models/Empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
__all__ = ["Empty"]


class Empty(Schema):
...
class Empty(Schema): ...

0 comments on commit 5597275

Please sign in to comment.