1{ lib
2, attrs
3, buildPythonPackage
4, fetchPypi
5, hatch-fancy-pypi-readme
6, hatch-vcs
7, hatchling
8, importlib-metadata
9, importlib-resources
10, pyrsistent
11, pythonOlder
12, twisted
13, typing-extensions
14}:
15
16buildPythonPackage rec {
17 pname = "jsonschema";
18 version = "4.17.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 sha256 = "sha256-W/zyvKFqCHreF+ArKC00r3zNdJ73YkHn+b18DLipQk0=";
26 };
27
28 postPatch = ''
29 patchShebangs json/bin/jsonschema_suite
30 '';
31
32 nativeBuildInputs = [
33 hatch-fancy-pypi-readme
34 hatch-vcs
35 hatchling
36 ];
37
38 propagatedBuildInputs = [
39 attrs
40 pyrsistent
41 ] ++ lib.optionals (pythonOlder "3.8") [
42 importlib-metadata
43 typing-extensions
44 ] ++ lib.optionals (pythonOlder "3.9") [
45 importlib-resources
46 ];
47
48 checkInputs = [
49 twisted
50 ];
51
52 checkPhase = ''
53 export JSON_SCHEMA_TEST_SUITE=json
54 trial jsonschema
55 '';
56
57 pythonImportsCheck = [
58 "jsonschema"
59 ];
60
61 meta = with lib; {
62 description = "An implementation of JSON Schema validation for Python";
63 homepage = "https://github.com/python-jsonschema/jsonschema";
64 license = licenses.mit;
65 maintainers = with maintainers; [ domenkozar ];
66 };
67}