summary refs log tree commit diff
path: root/pkgs/development/python-modules/flask-admin/default.nix
blob: 685c4e80945933691b474c3cea8fc88b9fde816c (plain) (blame)
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
{ lib
, arrow
, azure-storage-blob
, boto
, buildPythonPackage
, colour
, email-validator
, enum34
, fetchpatch
, fetchPypi
, flask
, flask-babelex
, flask-mongoengine
, flask-sqlalchemy
, geoalchemy2
, mongoengine
, pillow
, psycopg2
, pymongo
, pytestCheckHook
, pythonOlder
, shapely
, sqlalchemy
, sqlalchemy-citext
, sqlalchemy-utils
, wtf-peewee
, wtforms
}:

buildPythonPackage rec {
  pname = "flask-admin";
  version = "1.6.1";
  format = "setuptools";

  disabled = pythonOlder "3.8";

  src = fetchPypi {
    pname = "Flask-Admin";
    inherit version;
    hash = "sha256-JMrir4MramEaAdfcNfQtJmwdbHWkJrhp2MskG3gjM2k=";
  };

  patches = [
    # https://github.com/flask-admin/flask-admin/pull/2374
    (fetchpatch {
      name = "pillow-10-compatibility.patch";
      url = "https://github.com/flask-admin/flask-admin/commit/96b92deef8b087e86a9dc3e84381d254ea5c0342.patch";
      hash = "sha256-iR5kxyeZaEyved5InZuPmcglTD77zW18/eSHGwOuW40=";
    })
  ];

  propagatedBuildInputs = [
    flask
    wtforms
  ];

  passthru.optional-dependencies = {
    aws = [
      boto
    ];
    azure = [
      azure-storage-blob
    ];
  };

  nativeCheckInputs = [
    arrow
    colour
    email-validator
    flask-babelex
    flask-mongoengine
    flask-sqlalchemy
    geoalchemy2
    mongoengine
    pillow
    psycopg2
    pymongo
    pytestCheckHook
    shapely
    sqlalchemy
    sqlalchemy-citext
    sqlalchemy-utils
    wtf-peewee
  ];

  disabledTests = [
    # Incompatible with werkzeug 2.1
    "test_mockview"
    # Tests are outdated and don't work with peewee
    "test_nested_flask_views"
    "test_export_csv"
    "test_list_row_actions"
    "test_column_editable_list"
    "test_column_filters"
    "test_export_csv"
  ];

  disabledTestPaths = [
    # Tests have additional requirements
    "flask_admin/tests/geoa/test_basic.py"
    "flask_admin/tests/mongoengine/test_basic.py"
    "flask_admin/tests/pymongo/test_basic.py"
    "flask_admin/tests/sqla/test_basic.py"
    "flask_admin/tests/sqla/test_form_rules.py"
    "flask_admin/tests/sqla/test_inlineform.py"
    "flask_admin/tests/sqla/test_postgres.py"
    "flask_admin/tests/sqla/test_translation.py"
    # RuntimeError: Working outside of application context.
    "flask_admin/tests/sqla/test_multi_pk.py"
  ];

  pythonImportsCheck = [
    "flask_admin"
  ];

  meta = with lib; {
    description = "Admin interface framework for Flask";
    homepage = "https://github.com/flask-admin/flask-admin/";
    changelog = "https://github.com/flask-admin/flask-admin/releases/tag/v${version}";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}