1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pytestCheckHook, 7 pythonOlder, 8 setuptools, 9}: 10 11buildPythonPackage rec { 12 pname = "fastjsonschema"; 13 version = "2.21.1"; 14 pyproject = true; 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-H/jmvm5U4RB9KuD5EgCedbc499Fl8L2S9Y5SXy51JP0="; 24 }; 25 26 build-system = [ setuptools ]; 27 28 nativeCheckInputs = [ pytestCheckHook ]; 29 30 disabledTests = 31 [ 32 "benchmark" 33 # these tests require network access 34 "remote ref" 35 "definitions" 36 ] 37 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 38 "test_compile_to_code_custom_format" # cannot import temporary module created during test 39 ]; 40 41 pytestFlagsArray = [ 42 # fastjsonschema.exceptions.JsonSchemaDefinitionException: Unknown format uuid/duration 43 "--deselect=tests/json_schema/test_draft2019.py::test" 44 ]; 45 46 pythonImportsCheck = [ "fastjsonschema" ]; 47 48 meta = with lib; { 49 description = "JSON schema validator for Python"; 50 downloadPage = "https://github.com/horejsek/python-fastjsonschema"; 51 homepage = "https://horejsek.github.io/python-fastjsonschema/"; 52 license = licenses.bsd3; 53 maintainers = with maintainers; [ drewrisinger ]; 54 }; 55}