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