Skip to content

Commit 5a13aae

Browse files
committed
UV migration.
1 parent c236a2f commit 5a13aae

1 file changed

Lines changed: 82 additions & 88 deletions

File tree

fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 82 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,156 @@
1-
[tool.poetry]
1+
[project]
22
name = "{{cookiecutter.project_name}}"
33
version = "0.1.0"
4+
requires-python = ">=3.12,<4.0"
45
description = ""
5-
authors = [
6-
7-
]
8-
maintainers = [
9-
10-
]
6+
authors = []
7+
maintainers = []
118
readme = "README.md"
12-
13-
[tool.poetry.dependencies]
14-
python = ">3.9.1,<4"
15-
fastapi = "^0.115.6"
16-
uvicorn = { version = "^0.34.0", extras = ["standard"] }
17-
{%- if cookiecutter.gunicorn == "True" %}
18-
gunicorn = "^23.0.0"
19-
{%- endif %}
20-
{%- if cookiecutter.add_users == "True" %}
21-
{%- if cookiecutter.orm == "sqlalchemy" %}
22-
fastapi-users = "^14.0.0"
23-
httpx-oauth = "^0.16.1"
24-
fastapi-users-db-sqlalchemy = "^6.0.1"
25-
{%- endif %}
26-
{%- endif %}
27-
{%- if cookiecutter.orm == "ormar" %}
28-
pydantic = ">=2.5.3,<2.9.0"
29-
{%- else %}
30-
pydantic = "^2.10.4"
31-
{%- endif %}
32-
pydantic-settings = "^2.7.0"
33-
yarl = "^1.18.3"
34-
ujson = "^5.10.0"
9+
dependencies = [
10+
"fastapi>=0.115.6,<1",
11+
"uvicorn[standard]>=0.34.0,<1",
12+
{%- if cookiecutter.gunicorn == "True" %}
13+
"gunicorn>=23.0.0,<24",
14+
{%- endif %}
15+
{%- if cookiecutter.add_users == "True" %}
16+
{%- if cookiecutter.orm == "sqlalchemy" %}
17+
"fastapi-users>=14.0.0,<15",
18+
"httpx-oauth>=0.16.1,<1",
19+
"fastapi-users-db-sqlalchemy>=6.0.1,<1",
20+
{%- endif %}
21+
{%- endif %}
22+
{%- if cookiecutter.orm == "ormar" %}
23+
"pydantic>=2.5.3,<2.9.0",
24+
{%- else %}
25+
"pydantic>=2.10.4,<3",
26+
{%- endif %}
27+
"pydantic-settings>=2.7.0,<3",
28+
"yarl>=1.18.3,<2",
29+
"ujson>=5.10.0,6",
3530
{%- if cookiecutter.orm == "piccolo" %}
3631
{%- if cookiecutter.db_info.name == "postgresql" %}
37-
piccolo = {version = "^1.22.0", extras = ["postgres"]}
32+
"piccolo[postgres]>=1.22.0,<2",
3833
{%- elif cookiecutter.db_info.name == "sqlite" %}
39-
piccolo = {version = "^1.22.0", extras = ["sqlite"]}
34+
"piccolo[sqlite]>=1.22.0,<2",
4035
{%- endif %}
4136
{%- endif %}
4237
{%- if cookiecutter.orm == "sqlalchemy" %}
43-
SQLAlchemy = {version = "^2.0.36", extras = ["asyncio"]}
38+
"SQLAlchemy[asyncio]>=2.0.36,<3",
4439
{%- if cookiecutter.enable_migrations == "True" %}
45-
alembic = "^1.14.0"
40+
"alembic>=1.14.0,<2",
4641
{%- endif %}
4742
{%- if cookiecutter.db_info.name == "postgresql" %}
4843
asyncpg = {version = "^0.30.0", extras = ["sa"]}
44+
"asyncpg>=0.31.0,<1",
4945
{%- elif cookiecutter.db_info.name == "sqlite" %}
50-
aiosqlite = "^0.20.0"
46+
"aiosqlite>=0.20.0,<1",
5147
{%- elif cookiecutter.db_info.name == "mysql" %}
52-
aiomysql = "^0.2.0"
53-
mysqlclient = "^2.2.6"
48+
"aiomysql>=0.2.0,<1",
49+
"mysqlclient>=2.2.6,<3",
5450
{%- endif %}
5551
{%- endif %}
5652
{%- if cookiecutter.orm == "tortoise" %}
57-
tortoise-orm = "^0.23.0"
53+
"tortoise-orm>=0.23.0,<1",
5854
{%- if cookiecutter.enable_migrations == "True" %}
59-
aerich = "^0.8.0"
55+
"aerich>=0.8.0,<1",
6056
{%- endif %}
6157
{%- if cookiecutter.db_info.name == "postgresql" %}
62-
asyncpg = "^0.30.0"
58+
"asyncpg>=0.30.0,<1",
6359
{%- elif cookiecutter.db_info.name == "sqlite" %}
64-
aiosqlite = "<0.20.0"
60+
"aiosqlite>=0.20.0,<1",
6561
{%- elif cookiecutter.db_info.name == "mysql" %}
66-
aiomysql = "^0.2.0"
67-
mysqlclient = "^2.2.6"
68-
cryptography = "^44.0.0"
62+
"aiomysql>=0.2.0,<1",
63+
"mysqlclient>=2.2.6,<3",
64+
"cryptography>=44.0.0,<45",
6965
{%- endif %}
7066
{%- endif %}
7167
{%- if cookiecutter.orm == "ormar" %}
72-
ormar = "^0.20.2"
68+
"ormar>=0.20.2,<1",
7369
{%- if cookiecutter.enable_migrations == "True" %}
74-
alembic = "^1.14.0"
70+
"alembic>=1.14.0,<2",
7571
{%- endif %}
7672
{%- if cookiecutter.db_info.name == "postgresql" %}
77-
asyncpg = "^0.30.0"
78-
psycopg2-binary = "^2.9.10"
73+
"asyncpg>=0.30.0,<1",
74+
"psycopg2-binary>=2.9.10,<3",
7975
{%- elif cookiecutter.db_info.name == "sqlite" %}
80-
aiosqlite = "^0.20.0"
76+
"aiosqlite>=0.20.0,<1",
8177
{%- elif cookiecutter.db_info.name == "mysql" %}
82-
aiomysql = "^0.2.0"
83-
mysqlclient = "^2.2.6"
78+
"aiomysql>=0.2.0,<1",
79+
"mysqlclient>=2.2.6,<3",
8480
{%- endif %}
8581
{%- endif %}
8682
{%- if cookiecutter.enable_redis == "True" %}
87-
redis = {version = "^5.2.1", extras = ["hiredis"]}
83+
"redis[hiredis]>=5.2.1,<6",
8884
{%- endif %}
8985
{%- if cookiecutter.self_hosted_swagger == 'True' %}
90-
aiofiles = "^24.1.0"
86+
"aiofiles>=24.1.0,<25",
9187
{%- endif %}
9288
{%- if cookiecutter.orm == "psycopg" %}
93-
psycopg = { version = "^3.2.3", extras = ["binary", "pool"] }
89+
"psycopg[binary,pool]>=3.2.3,<4",
9490
{%- endif %}
95-
httptools = "^0.6.4"
91+
"httptools>=0.6.4,<1",
9692
{%- if cookiecutter.orm == "beanie" %}
97-
beanie = "^1.28.0"
93+
"beanie>=1.28.0,<2",
9894
{%- else %}
99-
pymongo = "^4.10.1"
95+
"pymongo>=4.10.1,<5",
10096
{%- endif %}
10197
{%- if cookiecutter.api_type == "graphql" %}
102-
strawberry-graphql = { version = "^0.256.1", extras = ["fastapi"] }
98+
"strawberry-graphql[fastapi]>=0.256.1,<1",
10399
{%- endif %}
104100
{%- if cookiecutter.enable_rmq == "True" %}
105-
aio-pika = "^9.5.4"
101+
"aio-pika>=9.5.4,<10",
106102
{%- endif %}
107103
{%- if cookiecutter.prometheus_enabled == "True" %}
108-
prometheus-client = "^0.21.1"
109-
prometheus-fastapi-instrumentator = "7.0.0"
104+
"prometheus-client>=0.21.1,<1",
105+
"prometheus-fastapi-instrumentator>=.0.0,<.1",
110106
{%- endif %}
111107
{%- if cookiecutter.sentry_enabled == "True" %}
112-
sentry-sdk = "^2.19.2"
108+
"sentry-sdk>=2.19.2,<3",
113109
{%- endif %}
114110
{%- if cookiecutter.otlp_enabled == "True" %}
115-
opentelemetry-api = "^1.29.0"
116-
opentelemetry-sdk = "^1.29.0"
117-
opentelemetry-exporter-otlp = "^1.29.0"
118-
opentelemetry-instrumentation = "^0.50b0"
119-
opentelemetry-instrumentation-fastapi = "^0.50b0"
111+
"opentelemetry-api>=1.29.0,<2",
112+
"opentelemetry-sdk>=1.29.0,<2",
113+
"opentelemetry-exporter-otlp>=1.29.0,<2",
114+
"opentelemetry-instrumentation>=0.50b0,<1",
115+
"opentelemetry-instrumentation-fastapi>=0.50b0,<1",
120116
{%- if cookiecutter.enable_loguru != "True" %}
121-
opentelemetry-instrumentation-logging = "^0.50b0"
117+
"opentelemetry-instrumentation-logging>=0.50b0,<1",
122118
{%- endif %}
123119
{%- if cookiecutter.enable_redis == "True" %}
124-
opentelemetry-instrumentation-redis = "^0.50b0"
120+
"opentelemetry-instrumentation-redis>=0.50b0,<1",
125121
{%- endif %}
126122
{%- if cookiecutter.db_info.name == "postgresql" and cookiecutter.orm in ["ormar", "tortoise"] %}
127-
opentelemetry-instrumentation-asyncpg = "^0.50b0"
123+
"opentelemetry-instrumentation-asyncpg>=0.50b0,<1",
128124
{%- endif %}
129125
{%- if cookiecutter.orm == "sqlalchemy" %}
130-
opentelemetry-instrumentation-sqlalchemy = "^0.50b0"
126+
"opentelemetry-instrumentation-sqlalchemy>=0.50b0,<1",
131127
{%- endif %}
132128
{%- if cookiecutter.enable_rmq == "True" %}
133-
opentelemetry-instrumentation-aio-pika = "^0.50b0"
129+
"opentelemetry-instrumentation-aio-pika>=0.50b0,<1",
134130
{%- endif %}
135131
{%- endif %}
136132
{%- if cookiecutter.enable_loguru == "True" %}
137-
loguru = "^0.7.3"
133+
"loguru>=0.7.3,<1",
138134
{%- endif %}
139135
{%- if cookiecutter.enable_kafka == "True" %}
140-
aiokafka = "^0.12.0"
136+
"aiokafka>=0.12.0,<1",
141137
{%- endif %}
142138
{%- if cookiecutter.enable_taskiq == "True" %}
143-
taskiq = "^0.11.10"
144-
taskiq-fastapi = "^0.3.3"
145-
146-
{%- if cookiecutter.enable_redis == "True" %}
147-
taskiq-redis = "^1.0.2"
148-
{%- endif %}
149-
150-
{%- if cookiecutter.enable_rmq == "True" %}
151-
taskiq-aio-pika = "^0.4.1"
152-
{%- endif %}
153-
154-
{%- if (cookiecutter.enable_rmq or cookiecutter.enable_rmq) != "True" %}
155-
pyzmq = "^26.2.0"
156-
{%- endif %}
139+
"taskiq>=0.11.10,<1",
140+
"taskiq-fastapi>=0.3.3,<1",
141+
{%- if cookiecutter.enable_redis == "True" %}
142+
"taskiq-redis>=1.0.2,<2",
143+
{%- endif %}
157144

145+
{%- if cookiecutter.enable_rmq == "True" %}
146+
"taskiq-aio-pika>=0.4.1,<1",
158147
{%- endif %}
159148

149+
{%- if (cookiecutter.enable_rmq or cookiecutter.enable_rmq) != "True" %}
150+
"pyzmq>=26.2.0,<27",
151+
{%- endif %}
152+
{%- endif %}
153+
]
160154

161155
[tool.poetry.group.dev.dependencies]
162156
pytest = "^8"

0 commit comments

Comments
 (0)