From ddacf10c7c02e3b3ed46802a1005cae59ee35d8d Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 10 Mar 2025 16:57:39 +0100 Subject: [PATCH] python3Packages.jsonschema-rs: init at 0.29.1 --- .../python-modules/jsonschema-rs/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/jsonschema-rs/default.nix diff --git a/pkgs/development/python-modules/jsonschema-rs/default.nix b/pkgs/development/python-modules/jsonschema-rs/default.nix new file mode 100644 index 000000000000..b11211ff687d --- /dev/null +++ b/pkgs/development/python-modules/jsonschema-rs/default.nix @@ -0,0 +1,51 @@ +{ + buildPythonPackage, + fetchPypi, + hypothesis, + lib, + pytestCheckHook, + pythonOlder, + rustPlatform, +}: + +buildPythonPackage rec { + pname = "jsonschema-rs"; + version = "0.29.1"; + + pyproject = true; + + disabled = pythonOlder "3.8"; + + # Fetching from Pypi, because there is no Cargo.lock in the GitHub repo. + src = fetchPypi { + inherit version; + pname = "jsonschema_rs"; + hash = "sha256-qfiWqeRRdjA3TxdTZHBYNsIvCdW9W7sG7AYRMytnAv0="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-kVi4EFig0ZGnOSVjzfJuGeR7BiEngP1Jhj6NvbhMVy4="; + }; + + nativeBuildInputs = with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]; + + nativeCheckInputs = [ + hypothesis + pytestCheckHook + ]; + + pythonImportsCheck = [ "jsonschema_rs" ]; + + meta = { + description = "High-performance JSON Schema validator for Python"; + homepage = "https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-py"; + changelog = "https://github.com/Stranger6667/jsonschema/blob/python-v${version}/crates/jsonschema-py/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = lib.teams.apm.members; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2cd4b17b455d..d87daf16c239 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6917,6 +6917,8 @@ self: super: with self; { jsonschema-path = callPackage ../development/python-modules/jsonschema-path { }; + jsonschema-rs = callPackage ../development/python-modules/jsonschema-rs { }; + jsonschema-spec = callPackage ../development/python-modules/jsonschema-spec { }; jsonschema-specifications = callPackage ../development/python-modules/jsonschema-specifications { };