1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch2,
7 pytestCheckHook,
8 pythonOlder,
9}:
10
11buildPythonPackage rec {
12 pname = "fastjsonschema";
13 version = "2.19.1";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "horejsek";
20 repo = "python-fastjsonschema";
21 rev = "v${version}";
22 fetchSubmodules = true;
23 hash = "sha256-UxcxVB4ldnGAYJKWEccivon1CwZD588mNiVJOJPNeN8=";
24 };
25
26 patches = [
27 (fetchpatch2 {
28 name = "fastjsonschema-pytest8-compat.patch";
29 url = "https://github.com/horejsek/python-fastjsonschema/commit/efc04daf4124a598182dfcfd497615cd1e633d18.patch";
30 hash = "sha256-G1/PIpdN+KFfRP9pUFf/ANXLq3mzrocEHyBNWQMVOZM=";
31 })
32 ];
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 dontUseSetuptoolsCheck = true;
37
38 disabledTests =
39 [
40 "benchmark"
41 # these tests require network access
42 "remote ref"
43 "definitions"
44 ]
45 ++ lib.optionals stdenv.isDarwin [
46 "test_compile_to_code_custom_format" # cannot import temporary module created during test
47 ];
48
49 pythonImportsCheck = [ "fastjsonschema" ];
50
51 meta = with lib; {
52 description = "JSON schema validator for Python";
53 homepage = "https://horejsek.github.io/python-fastjsonschema/";
54 license = licenses.bsd3;
55 maintainers = with maintainers; [ drewrisinger ];
56 };
57}