-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfastapi.nix
346 lines (291 loc) · 7.35 KB
/
fastapi.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
final: prev:
let
inherit (final) buildPythonPackage fetchPypi;
inherit (final.lib) licenses maintainers;
inherit (final.pkgs) fetchFromGitHub;
in
rec {
asgi-lifespan = buildPythonPackage rec {
pname = "asgi-lifespan";
version = "2.0.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "florimondmanca";
repo = pname;
rev = version;
hash = "sha256-wKwvCuHupAxIGxW53vUpIxcA1yx4kpWDX/coiNk+3MI=";
};
pythonImportsCheck = [
"asgi_lifespan"
];
preCheck = ''
cp ./setup.cfg ./setup.cfg.bak
sed '/addopts =/Q' ./setup.cfg.bak >./setup.cfg
'';
nativeCheckInputs = with final; [
pytestCheckHook
pytest-asyncio
starlette
trio
];
propagatedBuildInputs = with final; [
sniffio
];
meta = {
description = "Programmatic startup/shutdown of ASGI apps";
homepage = "https://github.com/florimondmanca/asgi-lifespan-db";
license = licenses.mit;
};
};
httpx-oauth = buildPythonPackage rec {
pname = "httpx-oauth";
version = "0.11.0";
pyproject = true;
src = fetchFromGitHub {
owner = "frankie567";
repo = pname;
rev = "v${version}";
hash = "sha256-zmoGr60hEudra3Bgt2sd+aovpvXmvfNL/LAcgkDI678=";
};
preBuild =
let
sed = "sed -i -E";
in
''
${sed} '/dynamic =/d' ./pyproject.toml
${sed} '/addopts =/d' ./pyproject.toml
${sed} 's#(\[project\])#\1\nversion = "${version}"#g' ./pyproject.toml
'';
pythonImportsCheck = [
"httpx_oauth"
];
nativeBuildInputs = with final; [
hatch-vcs
hatchling
];
nativeCheckInputs = with final; [
pytestCheckHook
pytest-asyncio
pytest-mock
fastapi
respx
];
propagatedBuildInputs = with final; [
httpx
];
meta = {
description = "";
homepage = "https://github.com/frankie567/httpx-oauth";
license = licenses.mit;
maintainers = with maintainers; [ jpetrucciani ];
};
};
fastapi-users = buildPythonPackage rec {
pname = "fastapi-users";
version = "10.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "fastapi-users";
repo = pname;
rev = "v${version}";
hash = "sha256-PzcO6GNzi7BN3FZU3Eu6FxJdzqhaBVt2nIst3OYQrPQ=";
};
preBuild =
let
sed = "sed -i -E";
in
''
${sed} '/dynamic =/d' ./pyproject.toml
${sed} 's#(\[project\])#\1\nversion = "${version}"#g' ./pyproject.toml
'';
pythonImportsCheck = [
"fastapi_users"
];
nativeBuildInputs = with final; [
hatch-vcs
hatchling
];
nativeCheckInputs = with final; [
pytestCheckHook
asgi-lifespan
pytest-asyncio
pytest-mock
redis
];
propagatedBuildInputs = with final; [
bcrypt
cryptography
fastapi
httpx-oauth
makefun
passlib
pyjwt
python-multipart
typing-extensions
];
meta = {
description = "Ready-to-use and customizable users management for FastAPI";
homepage = "https://github.com/fastapi-users/fastapi-users";
license = licenses.mit;
maintainers = with maintainers; [ jpetrucciani ];
};
};
ormar-postgres-extensions = buildPythonPackage rec {
pname = "ormar-postgres-extensions";
version = "2.9.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "tophat";
repo = pname;
rev = "v${version}";
hash = "sha256-s4+H8RwZbtBzZ+jLZweC1fPPkRtgEiFTXwWOrNEBClM=";
};
preBuild = ''
substituteInPlace ./setup.py --replace 'psycopg2-binary' 'psycopg2'
'';
pythonImportsCheck = [
"ormar_postgres_extensions"
];
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = with final; [
setuptools-scm
];
nativeCheckInputs = with final; [
pytestCheckHook
pytest-asyncio
];
propagatedBuildInputs = with final; [
asyncpg
ormar
psycopg2
pydantic
sqlalchemy
];
doCheck = false;
meta = {
description = "Extensions to the Ormar ORM to support PostgreSQL specific types";
homepage = "https://github.com/tophat/ormar-postgres-extensions";
license = licenses.asl20;
};
};
vbuild = buildPythonPackage rec {
pname = "vbuild";
version = "0.8.2";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-JwzZB4NJ2QffrmwOY2SlpedMuGGDu1CTYT8SoYtDX6k=";
};
postPatch = ''
sed -i -E 's#(poetry)>=0.12#\1-core#g' ./pyproject.toml
substituteInPlace ./pyproject.toml --replace "poetry.masonry.api" "poetry.core.masonry.api"
'';
nativeBuildInputs = with final; [
poetry-core
];
propagatedBuildInputs = with final; [
pscript
];
pythonImportsCheck = [ "vbuild" ];
meta = {
description = "A simple module to extract html/script/style from a vuejs '.vue' file (can minimize/es2015 compliant js) ... just py2 or py3, NO nodejs";
homepage = "https://github.com/manatlan/vbuild";
license = licenses.mit;
maintainers = with maintainers; [ jpetrucciani ];
};
};
fastapi-socketio = buildPythonPackage rec {
pname = "fastapi-socketio";
version = "0.0.10";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-IC+bMZ8BAAHL0RFOySoNnrX1ypMW6uX9QaYIjaCBJyc=";
};
propagatedBuildInputs = with final; [
fastapi
python-socketio
];
passthru.optional-dependencies = with final; {
test = [
pytest
];
};
doCheck = false;
pythonImportsCheck = [ "fastapi_socketio" ];
meta = {
description = "Easily integrate socket.io with your FastAPI app";
homepage = "https://github.com/pyropy/fastapi-socketio";
license = licenses.asl20;
maintainers = with maintainers; [ jpetrucciani ];
};
};
nicegui = buildPythonPackage rec {
pname = "nicegui";
version = "2.11.1";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-lijXakpeeohintpryp+bquEKN9i5TGPZnhr5S7W8nAU=";
};
postPatch = ''
sed -i -E 's#(setuptools)>=30.3.0,<50#\1#g' ./pyproject.toml
'';
nativeBuildInputs = with final; [
pythonRelaxDepsHook
poetry-core
setuptools
];
pythonRelaxDeps = [
"aiohttp"
"certifi"
"docutils"
"fastapi"
"httpx"
"jinja2"
"orjson"
"python-multipart"
"requests"
"uvicorn"
"watchfiles"
];
propagatedBuildInputs = with final; [
aiofiles
aiohttp
colorama
docutils
fastapi
fastapi-socketio
httptools
httpx
ifaddr
importlib-metadata
itsdangerous
jinja2
markdown2
matplotlib
orjson
plotly
pygments
python-dotenv
python-magic
python-multipart
pywebview
requests
typing-extensions
urllib3
uvicorn
uvloop
vbuild
watchfiles
websockets
];
pythonImportsCheck = [ "nicegui" ];
meta = {
description = "Create web-based interfaces with Python. The nice way";
homepage = "https://github.com/zauberzeug/nicegui";
license = licenses.mit;
maintainers = with maintainers; [ jpetrucciani ];
};
};
}