1{
2 lib,
3 azure-storage-blob,
4 buildPythonPackage,
5 fetchpatch,
6 fetchFromGitHub,
7 flask,
8 flask-mongoengine,
9 flask-sqlalchemy,
10 geoalchemy2,
11 mongoengine,
12 pillow,
13 psycopg2,
14 pymongo,
15 pytestCheckHook,
16 pythonOlder,
17 setuptools,
18 shapely,
19 sqlalchemy,
20 wtf-peewee,
21 wtforms,
22}:
23
24buildPythonPackage rec {
25 pname = "flask-admin";
26 version = "1.6.1";
27 pyproject = true;
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchFromGitHub {
32 owner = "flask-admin";
33 repo = "flask-admin";
34 tag = "v${version}";
35 hash = "sha256-L8Q9uPpoen6ZvuF2bithCMSgc6X5khD1EqH2FJPspZc=";
36 };
37
38 patches = [
39 # https://github.com/flask-admin/flask-admin/pull/2374
40 (fetchpatch {
41 name = "pillow-10-compatibility.patch";
42 url = "https://github.com/flask-admin/flask-admin/commit/96b92deef8b087e86a9dc3e84381d254ea5c0342.patch";
43 hash = "sha256-iR5kxyeZaEyved5InZuPmcglTD77zW18/eSHGwOuW40=";
44 })
45 ];
46
47 build-system = [ setuptools ];
48
49 dependencies = [
50 flask
51 wtforms
52 ];
53
54 optional-dependencies = {
55 azure = [ azure-storage-blob ];
56 };
57
58 nativeCheckInputs = [
59 pillow
60 mongoengine
61 pymongo
62 wtf-peewee
63 sqlalchemy
64 flask-mongoengine
65 flask-sqlalchemy
66 # flask-babelex # broken and removed
67 shapely
68 geoalchemy2
69 psycopg2
70 pytestCheckHook
71 ];
72
73 disabledTestPaths = [
74 # depends on flask-babelex
75 "flask_admin/tests/sqla/test_basic.py"
76 "flask_admin/tests/sqla/test_form_rules.py"
77 "flask_admin/tests/sqla/test_multi_pk.py"
78 "flask_admin/tests/sqla/test_postgres.py"
79 "flask_admin/tests/sqla/test_translation.py"
80 # broken
81 "flask_admin/tests/sqla/test_inlineform.py"
82 "flask_admin/tests/test_model.py"
83 "flask_admin/tests/fileadmin/test_fileadmin.py"
84 # requires database
85 "flask_admin/tests/geoa/test_basic.py"
86 "flask_admin/tests/pymongo/test_basic.py"
87 "flask_admin/tests/mongoengine/test_basic.py"
88 "flask_admin/tests/peeweemodel/test_basic.py"
89 ];
90
91 pythonImportsCheck = [ "flask_admin" ];
92
93 meta = with lib; {
94 description = "Admin interface framework for Flask";
95 homepage = "https://github.com/flask-admin/flask-admin/";
96 changelog = "https://github.com/flask-admin/flask-admin/releases/tag/v${version}";
97 license = licenses.bsd3;
98 maintainers = with maintainers; [ nickcao ];
99 };
100}