1{ lib
2, fetchPypi
3, fetchpatch
4, buildPythonPackage
5, flask
6, itsdangerous
7, wtforms
8, email-validator
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "flask-wtf";
14 version = "1.0.1";
15
16 src = fetchPypi {
17 pname = "Flask-WTF";
18 inherit version;
19 sha256 = "34fe5c6fee0f69b50e30f81a3b7ea16aa1492a771fe9ad0974d164610c09a6c9";
20 };
21
22 patches = [
23 # Fix failing `test_set_default_message_language` test
24 #
25 # Caused by Flask 2.2 that throws an error when setup methods are
26 # mistakenly called before the first request.
27 #
28 # Will be fixed upstream with: https://github.com/wtforms/flask-wtf/pull/533
29 #
30 (fetchpatch {
31 url = "https://github.com/wtforms/flask-wtf/commit/36a53fadf7bc42c79a1428657531961ec30ca003.patch";
32 hash = "sha256-bgLwDG9Wpufm6fd/6PS83Jvvuk1Ha6XdyaWngluPs30=";
33 })
34 ];
35
36 propagatedBuildInputs = [
37 flask
38 itsdangerous
39 wtforms
40 ];
41
42 passthru.optional-dependencies = {
43 email = [ email-validator ];
44 };
45
46 checkInputs = [
47 pytestCheckHook
48 ];
49
50 meta = with lib; {
51 description = "Simple integration of Flask and WTForms.";
52 license = licenses.bsd3;
53 maintainers = with maintainers; [ mic92 anthonyroussel ];
54 homepage = "https://github.com/lepture/flask-wtf/";
55 };
56}