Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / jsonschema / default.nix
blob97147b055e93be53eb60ec8e8b19ec82780fd085
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
17 # optionals
18 , fqdn
19 , idna
20 , isoduration
21 , jsonpointer
22 , rfc3339-validator
23 , rfc3986-validator
24 , rfc3987
25 , uri-template
26 , webcolors
29 buildPythonPackage rec {
30   pname = "jsonschema";
31   version = "4.21.1";
32   format = "pyproject";
34   disabled = pythonOlder "3.8";
36   src = fetchPypi {
37     inherit pname version;
38     hash = "sha256-hXJ8ACefX6a+2+YjjSqmQDvt2LSGSrESB9B988wbLuU=";
39   };
41   postPatch = ''
42     patchShebangs json/bin/jsonschema_suite
43   '';
45   nativeBuildInputs = [
46     hatch-fancy-pypi-readme
47     hatch-vcs
48     hatchling
49   ];
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   ];
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   };
84   nativeCheckInputs = [
85     pip
86     pytestCheckHook
87   ];
89   pythonImportsCheck = [
90     "jsonschema"
91   ];
93   meta = with lib; {
94     description = "An implementation of JSON Schema validation";
95     mainProgram = "jsonschema";
96     homepage = "https://github.com/python-jsonschema/jsonschema";
97     license = licenses.mit;
98     maintainers = with maintainers; [ domenkozar ];
99   };