1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 babel,
9 hatchling,
10 setuptools,
11
12 # dependencies
13 markupsafe,
14
15 # optional-dependencies
16 email-validator,
17
18 # tests
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "wtforms";
24 version = "3.2.1";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "wtforms";
31 repo = "wtforms";
32 tag = version;
33 hash = "sha256-jwjP/wkk8MdNJbPE8MlkrH4DyR304Ju41nN4lMo3jFs=";
34 };
35
36 nativeBuildInputs = [
37 babel
38 hatchling
39 setuptools
40 ];
41
42 propagatedBuildInputs = [ markupsafe ];
43
44 optional-dependencies = {
45 email = [ email-validator ];
46 };
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 ]
51 ++ lib.flatten (lib.attrValues optional-dependencies);
52
53 pythonImportsCheck = [ "wtforms" ];
54
55 meta = with lib; {
56 description = "Flexible forms validation and rendering library for Python";
57 homepage = "https://github.com/wtforms/wtforms";
58 changelog = "https://github.com/wtforms/wtforms/blob/${version}/CHANGES.rst";
59 license = licenses.bsd3;
60 maintainers = with maintainers; [ bhipple ];
61 };
62}