From f8e44576119ffe2d294a80b29a4448c12d39c5d4 Mon Sep 17 00:00:00 2001 From: Aos Dabbagh <25783780+aos@users.noreply.github.com> Date: Mon, 22 Dec 2025 03:08:45 -0500 Subject: [PATCH] python3Packages.json-schema-to-pydantic: init at 0.4.7 this is required for llm-anthropic v0.23 --- .../json-schema-to-pydantic/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/json-schema-to-pydantic/default.nix diff --git a/pkgs/development/python-modules/json-schema-to-pydantic/default.nix b/pkgs/development/python-modules/json-schema-to-pydantic/default.nix new file mode 100644 index 000000000000..95fe4833768e --- /dev/null +++ b/pkgs/development/python-modules/json-schema-to-pydantic/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + hatch-vcs, + pydantic, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "json-schema-to-pydantic"; + version = "0.4.9"; + pyproject = true; + + src = fetchFromGitHub { + owner = "richard-gyiko"; + repo = "json-schema-to-pydantic"; + tag = "v${finalAttrs.version}"; + hash = "sha256-j3E3jkb9l5s4JnGeBACG4/GznB1F+S2Fh0ncZEvvXuM="; + }; + + build-system = [ + hatchling + hatch-vcs + ]; + + dependencies = [ pydantic ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "json_schema_to_pydantic" ]; + + meta = { + description = "Generates Pydantic v2 models from JSON Schema definitions"; + homepage = "https://github.com/richard-gyiko/json-schema-to-pydantic"; + changelog = "https://github.com/richard-gyiko/json-schema-to-pydantic/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aos ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 566ff9ef990e..2a25d9f19ead 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7818,6 +7818,8 @@ self: super: with self; { json-schema-for-humans = callPackage ../development/python-modules/json-schema-for-humans { }; + json-schema-to-pydantic = callPackage ../development/python-modules/json-schema-to-pydantic { }; + json-stream = callPackage ../development/python-modules/json-stream { }; json-stream-rs-tokenizer = callPackage ../development/python-modules/json-stream-rs-tokenizer { };