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