1{ lib
2, attrs
3, buildPythonPackage
4, fetchPypi
5, hatch-fancy-pypi-readme
6, hatch-vcs
7, hatchling
8, importlib-resources
9, jsonschema-specifications
10, pkgutil-resolve-name
11, pip
12, pytestCheckHook
13, pythonOlder
14, referencing
15, rpds-py
16
17# optionals
18, fqdn
19, idna
20, isoduration
21, jsonpointer
22, rfc3339-validator
23, rfc3986-validator
24, rfc3987
25, uri-template
26, webcolors
27}:
28
29buildPythonPackage rec {
30 pname = "jsonschema";
31 version = "4.19.0";
32 format = "pyproject";
33
34 disabled = pythonOlder "3.8";
35
36 src = fetchPypi {
37 inherit pname version;
38 hash = "sha256-bh51aawTvoE5st0sIaVdNQBm7j+A3wbGCLOYzcbzDo8=";
39 };
40
41 postPatch = ''
42 patchShebangs json/bin/jsonschema_suite
43 '';
44
45 nativeBuildInputs = [
46 hatch-fancy-pypi-readme
47 hatch-vcs
48 hatchling
49 ];
50
51 propagatedBuildInputs = [
52 attrs
53 jsonschema-specifications
54 referencing
55 rpds-py
56 ] ++ lib.optionals (pythonOlder "3.9") [
57 importlib-resources
58 pkgutil-resolve-name
59 ];
60
61 passthru.optional-dependencies = {
62 format = [
63 fqdn
64 idna
65 isoduration
66 jsonpointer
67 rfc3339-validator
68 rfc3987
69 uri-template
70 webcolors
71 ];
72 format-nongpl = [
73 fqdn
74 idna
75 isoduration
76 jsonpointer
77 rfc3339-validator
78 rfc3986-validator
79 uri-template
80 webcolors
81 ];
82 };
83
84 nativeCheckInputs = [
85 pip
86 pytestCheckHook
87 ];
88
89 pythonImportsCheck = [
90 "jsonschema"
91 ];
92
93 meta = with lib; {
94 description = "An implementation of JSON Schema validation";
95 homepage = "https://github.com/python-jsonschema/jsonschema";
96 license = licenses.mit;
97 maintainers = with maintainers; [ domenkozar ];
98 };
99}