Skip to content

Commit

Permalink
Dependencies were updated.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kirilin <[email protected]>
  • Loading branch information
s3rius committed Jun 30, 2024
1 parent 9c2c06c commit 22b147e
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 88 deletions.
128 changes: 64 additions & 64 deletions fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,165 +12,165 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"
fastapi = "^0.100.0"
uvicorn = { version = "^0.22.0", extras = ["standard"] }
fastapi = "^0.111.0"
uvicorn = { version = "^0.30.1", extras = ["standard"] }
{%- if cookiecutter.gunicorn == "True" %}
gunicorn = "^21.2.0"
gunicorn = "^22.0.0"
{%- endif %}
{%- if cookiecutter.add_users == "True" %}
{%- if cookiecutter.orm == "sqlalchemy" %}
fastapi-users = "^12.1.2"
httpx-oauth = "^0.10.2"
fastapi-users = "^13.0.0"
httpx-oauth = "^0.14.1"
fastapi-users-db-sqlalchemy = "^6.0.1"
{%- endif %}
{%- endif %}
pydantic = "^2"
pydantic-settings = "^2"
yarl = "^1.9.2"
ujson = "^5.8.0"
yarl = "^1"
ujson = "^5.10.0"
{%- if cookiecutter.orm == "piccolo" %}
{%- if cookiecutter.db_info.name == "postgresql" %}
piccolo = {version = "^0.117.0", extras = ["postgres"]}
piccolo = {version = "^1.13.0", extras = ["postgres"]}
{%- elif cookiecutter.db_info.name == "sqlite" %}
piccolo = {version = "^0.117.0", extras = ["sqlite"]}
piccolo = {version = "^1.13.0", extras = ["sqlite"]}
{%- endif %}
{%- endif %}
{%- if cookiecutter.orm == "sqlalchemy" %}
SQLAlchemy = {version = "^2.0.18", extras = ["asyncio"]}
SQLAlchemy = {version = "^2.0.31", extras = ["asyncio"]}
{%- if cookiecutter.enable_migrations == "True" %}
alembic = "^1.11.1"
alembic = "^1.13.2"
{%- endif %}
{%- if cookiecutter.db_info.name == "postgresql" %}
asyncpg = {version = "^0.28.0", extras = ["sa"]}
asyncpg = {version = "^0.29.0", extras = ["sa"]}
{%- elif cookiecutter.db_info.name == "sqlite" %}
aiosqlite = "^0.19.0"
aiosqlite = "^0.20.0"
{%- elif cookiecutter.db_info.name == "mysql" %}
aiomysql = "^0.2.0"
mysqlclient = "^2.2.0"
mysqlclient = "^2.2.4"
{%- endif %}
{%- endif %}
{%- if cookiecutter.orm == "tortoise" %}
tortoise-orm = "^0.19.3"
tortoise-orm = "^0.21.3"
{%- if cookiecutter.enable_migrations == "True" %}
aerich = "^0.7.1"
aerich = "^0.7.2"
{%- endif %}
{%- if cookiecutter.db_info.name == "postgresql" %}
asyncpg = "^0.28.0"
asyncpg = "^0.29.0"
{%- elif cookiecutter.db_info.name == "sqlite" %}
aiosqlite = "<0.19.0"
aiosqlite = "<0.20.0"
{%- elif cookiecutter.db_info.name == "mysql" %}
aiomysql = "^0.2.0"
mysqlclient = "^2.2.0"
cryptography = "^41.0.1"
mysqlclient = "^2.2.4"
cryptography = "^42.0.8"
{%- endif %}
{%- endif %}
{%- if cookiecutter.orm == "ormar" %}
ormar = "^0.12.2"
ormar = "^0.20.1"
{%- if cookiecutter.enable_migrations == "True" %}
alembic = "^1.11.1"
alembic = "^1.13.2"
{%- endif %}
{%- if cookiecutter.db_info.name == "postgresql" %}
asyncpg = "^0.28.0"
psycopg2-binary = "^2.9.6"
asyncpg = "^0.29.0"
psycopg2-binary = "^2.9.9"
{%- elif cookiecutter.db_info.name == "sqlite" %}
aiosqlite = "^0.19.0"
aiosqlite = "^0.20.0"
{%- elif cookiecutter.db_info.name == "mysql" %}
aiomysql = "^0.2.0"
mysqlclient = "^2.2.0"
mysqlclient = "^2.2.4"
{%- endif %}
{%- endif %}
{%- if cookiecutter.enable_redis == "True" %}
redis = {version = "^4.6.0", extras = ["hiredis"]}
redis = {version = "^5.0.7", extras = ["hiredis"]}
{%- endif %}
{%- if cookiecutter.self_hosted_swagger == 'True' %}
aiofiles = "^23.1.0"
aiofiles = "^24.1.0"
{%- endif %}
{%- if cookiecutter.orm == "psycopg" %}
psycopg = { version = "^3.1.9", extras = ["binary", "pool"] }
psycopg = { version = "^3.1.19", extras = ["binary", "pool"] }
{%- endif %}
httptools = "^0.6.0"
httptools = "^0.6.1"
{%- if cookiecutter.orm == "beanie" %}
beanie = "^1.21.0"
beanie = "^1.26.0"
{%- else %}
pymongo = "^4.5.0"
pymongo = "^4.8.0"
{%- endif %}
{%- if cookiecutter.api_type == "graphql" %}
strawberry-graphql = { version = "^0.194.4", extras = ["fastapi"] }
strawberry-graphql = { version = "^0.235.1", extras = ["fastapi"] }
{%- endif %}
{%- if cookiecutter.enable_rmq == "True" %}
aio-pika = "^9.1.4"
aio-pika = "^9.4.1"
{%- endif %}
{%- if cookiecutter.prometheus_enabled == "True" %}
prometheus-client = "^0.17.0"
prometheus-fastapi-instrumentator = "6.0.0"
prometheus-client = "^0.20.0"
prometheus-fastapi-instrumentator = "7.0.0"
{%- endif %}
{%- if cookiecutter.sentry_enabled == "True" %}
sentry-sdk = "^1.27.1"
sentry-sdk = "^2.7.1"
{%- endif %}
{%- if cookiecutter.otlp_enabled == "True" %}
opentelemetry-api = "^1.18.0"
opentelemetry-sdk = "^1.18.0"
opentelemetry-exporter-otlp = "^1.18.0"
opentelemetry-instrumentation = "^0.39b0"
opentelemetry-instrumentation-fastapi = "^0.39b0"
opentelemetry-api = "^1.25.0"
opentelemetry-sdk = "^1.25.0"
opentelemetry-exporter-otlp = "^1.25.0"
opentelemetry-instrumentation = "^0.46b0"
opentelemetry-instrumentation-fastapi = "^0.46b0"
{%- if cookiecutter.enable_loguru != "True" %}
opentelemetry-instrumentation-logging = "^0.39b0"
opentelemetry-instrumentation-logging = "^0.46b0"
{%- endif %}
{%- if cookiecutter.enable_redis == "True" %}
opentelemetry-instrumentation-redis = "^0.39b0"
opentelemetry-instrumentation-redis = "^0.46b0"
{%- endif %}
{%- if cookiecutter.db_info.name == "postgresql" and cookiecutter.orm in ["ormar", "tortoise"] %}
opentelemetry-instrumentation-asyncpg = "^0.39b0"
opentelemetry-instrumentation-asyncpg = "^0.46b0"
{%- endif %}
{%- if cookiecutter.orm == "sqlalchemy" %}
opentelemetry-instrumentation-sqlalchemy = "^0.39b0"
opentelemetry-instrumentation-sqlalchemy = "^0.46b0"
{%- endif %}
{%- if cookiecutter.enable_rmq == "True" %}
opentelemetry-instrumentation-aio-pika = "^0.39b0"
opentelemetry-instrumentation-aio-pika = "^0.46b0"
{%- endif %}
{%- endif %}
{%- if cookiecutter.enable_loguru == "True" %}
loguru = "^0.7.0"
loguru = "^0"
{%- endif %}
{%- if cookiecutter.enable_kafka == "True" %}
aiokafka = "^0.8.1"
aiokafka = "^0"
{%- endif %}
{%- if cookiecutter.enable_taskiq == "True" %}
taskiq = "^0"
taskiq-fastapi = "^0"

{%- if cookiecutter.enable_redis == "True" %}
taskiq-redis = "^0"
taskiq-redis = "^1"
{%- endif %}

{%- if cookiecutter.enable_rmq == "True" %}
taskiq-aio-pika = "^0"
taskiq-aio-pika = "^0"
{%- endif %}

{%- if (cookiecutter.enable_rmq or cookiecutter.enable_rmq) != "True" %}
pyzmq = "^25"
pyzmq = "^26"
{%- endif %}

{%- endif %}


[tool.poetry.dev-dependencies]
pytest = "^7.2.1"
ruff = "^0"
mypy = "^1.1.1"
pre-commit = "^3.0.1"
black = "^22.12.0"
pytest-cov = "^4.0.0"
anyio = "^3.6.2"
pytest-env = "^0.8.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8"
ruff = "^0.5.0"
mypy = "^1.10.1"
pre-commit = "^3.7.1"
black = "^24.4.2"
pytest-cov = "^5"
anyio = "^4"
pytest-env = "^1.1.3"
{%- if cookiecutter.enable_redis == "True" %}
fakeredis = "^2.5.0"
fakeredis = "^2.23.3"
{%- endif %}
{%- if cookiecutter.orm == "tortoise" %}
asynctest = "^0.13.0"
nest-asyncio = "^1.5.6"
nest-asyncio = "^1.6.0"
{%- endif %}
httpx = "^0.23.3"
httpx = "^0.27.0"
{%- if cookiecutter.enable_taskiq == "True" %}
taskiq = { version = "^0", extras = ["reload"] }
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from ormar import ModelMeta
from {{cookiecutter.project_name}}.db.config import database
from {{cookiecutter.project_name}}.db.meta import meta
import sqlalchemy as sa
from databases import Database
from ormar import OrmarConfig
from {{cookiecutter.project_name}}.settings import settings

meta = sa.MetaData()
database = Database(str(settings.db_url))

class BaseMeta(ModelMeta):
"""Base metadata for models."""
ormar_config = OrmarConfig(metadata=meta, database=database)

database = database
metadata = meta

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from alembic import context
from sqlalchemy.engine import Connection, create_engine
from {{cookiecutter.project_name}}.db.meta import meta
from {{cookiecutter.project_name}}.db.base import meta
from {{cookiecutter.project_name}}.db.models import load_all_models
from {{cookiecutter.project_name}}.settings import settings

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import ormar
from {{cookiecutter.project_name}}.db.base import BaseMeta
from {{cookiecutter.project_name}}.db.base import ormar_config


class DummyModel(ormar.Model):
"""Model for demo purpose."""

class Meta(BaseMeta):
tablename = "dummy_model"
ormar_config = ormar_config.copy(tablename="dummy_model")

id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=200) # noqa: WPS432
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Any
import taskiq_fastapi
from taskiq import InMemoryBroker, ZeroMQBroker
from taskiq import InMemoryBroker, ZeroMQBroker, AsyncBroker, AsyncResultBackend
from {{cookiecutter.project_name}}.settings import settings

{%- if cookiecutter.enable_redis == "True" %}
Expand All @@ -13,22 +14,22 @@
{%- endif %}

{%- if cookiecutter.enable_redis == "True" %}
result_backend = RedisAsyncResultBackend(
result_backend: AsyncResultBackend[Any] = RedisAsyncResultBackend(
redis_url=str(settings.redis_url.with_path("/1")),
)
{%- endif %}


{%- if cookiecutter.enable_rmq == "True" %}
broker = AioPikaBroker(
broker: AsyncBroker = AioPikaBroker(
str(settings.rabbit_url),
){%- if cookiecutter.enable_redis == "True" %}.with_result_backend(result_backend){%- endif %}
{%- elif cookiecutter.enable_redis == "True" %}
broker = ListQueueBroker(
broker: AsyncBroker = ListQueueBroker(
str(settings.redis_url.with_path("/1")),
).with_result_backend(result_backend)
{%- else %}
broker = ZeroMQBroker()
broker: AsyncBroker = ZeroMQBroker()
{%- endif %}

if settings.environment.lower() == "pytest":
Expand Down

0 comments on commit 22b147e

Please sign in to comment.