Skip to content

Commit ddacf10

Browse files
python3Packages.jsonschema-rs: init at 0.29.1
1 parent b882546 commit ddacf10

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
buildPythonPackage,
3+
fetchPypi,
4+
hypothesis,
5+
lib,
6+
pytestCheckHook,
7+
pythonOlder,
8+
rustPlatform,
9+
}:
10+
11+
buildPythonPackage rec {
12+
pname = "jsonschema-rs";
13+
version = "0.29.1";
14+
15+
pyproject = true;
16+
17+
disabled = pythonOlder "3.8";
18+
19+
# Fetching from Pypi, because there is no Cargo.lock in the GitHub repo.
20+
src = fetchPypi {
21+
inherit version;
22+
pname = "jsonschema_rs";
23+
hash = "sha256-qfiWqeRRdjA3TxdTZHBYNsIvCdW9W7sG7AYRMytnAv0=";
24+
};
25+
26+
cargoDeps = rustPlatform.fetchCargoVendor {
27+
inherit src;
28+
name = "${pname}-${version}";
29+
hash = "sha256-kVi4EFig0ZGnOSVjzfJuGeR7BiEngP1Jhj6NvbhMVy4=";
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+
meta = {
45+
description = "High-performance JSON Schema validator for Python";
46+
homepage = "https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-py";
47+
changelog = "https://github.com/Stranger6667/jsonschema/blob/python-v${version}/crates/jsonschema-py/CHANGELOG.md";
48+
license = lib.licenses.mit;
49+
maintainers = lib.teams.apm.members;
50+
};
51+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6917,6 +6917,8 @@ self: super: with self; {
69176917

69186918
jsonschema-path = callPackage ../development/python-modules/jsonschema-path { };
69196919

6920+
jsonschema-rs = callPackage ../development/python-modules/jsonschema-rs { };
6921+
69206922
jsonschema-spec = callPackage ../development/python-modules/jsonschema-spec { };
69216923

69226924
jsonschema-specifications = callPackage ../development/python-modules/jsonschema-specifications { };

0 commit comments

Comments
 (0)