1{ 2 buildPythonPackage, 3 fetchPypi, 4 hypothesis, 5 lib, 6 nix-update-script, 7 pytestCheckHook, 8 pythonOlder, 9 rustPlatform, 10}: 11 12buildPythonPackage rec { 13 pname = "jsonschema-rs"; 14 version = "0.33.0"; 15 16 pyproject = true; 17 18 disabled = pythonOlder "3.8"; 19 20 # Fetching from Pypi, because there is no Cargo.lock in the GitHub repo. 21 src = fetchPypi { 22 inherit version; 23 pname = "jsonschema_rs"; 24 hash = "sha256-PRi2xwfGra6cgSynLldOHp+HKeVPwAFGFYintXfUPc8="; 25 }; 26 27 cargoDeps = rustPlatform.fetchCargoVendor { 28 inherit pname version src; 29 hash = "sha256-P305DiFzU4UfD1PLLU4ayCfLS714VzkWlB3AM4U5ovk="; 30 }; 31 32 nativeBuildInputs = with rustPlatform; [ 33 cargoSetupHook 34 maturinBuildHook 35 ]; 36 37 nativeCheckInputs = [ 38 hypothesis 39 pytestCheckHook 40 ]; 41 42 pythonImportsCheck = [ "jsonschema_rs" ]; 43 44 passthru.updateScript = nix-update-script { }; 45 46 meta = { 47 description = "High-performance JSON Schema validator for Python"; 48 homepage = "https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-py"; 49 changelog = "https://github.com/Stranger6667/jsonschema/blob/python-v${version}/crates/jsonschema-py/CHANGELOG.md"; 50 license = lib.licenses.mit; 51 teams = [ lib.teams.apm ]; 52 }; 53}