From 74d3202fca5d3790ccc5cd133bcfc54641067336 Mon Sep 17 00:00:00 2001 From: BatteredBunny Date: Sat, 17 Jan 2026 19:41:30 +0200 Subject: [PATCH] python3Packages.formatron: fix usage with newest version of pydantic --- pkgs/development/python-modules/formatron/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/formatron/default.nix b/pkgs/development/python-modules/formatron/default.nix index 0353fc4d7b8b..185ab306b71d 100644 --- a/pkgs/development/python-modules/formatron/default.nix +++ b/pkgs/development/python-modules/formatron/default.nix @@ -24,6 +24,17 @@ buildPythonPackage rec { fetchSubmodules = true; }; + postPatch = '' + # Fix pydantic compatibility + # https://github.com/Dan-wanna-M/formatron/issues/35 + substituteInPlace src/formatron/schemas/dict_inference.py \ + --replace-fail 'typing.Type' 'Type' \ + --replace-fail 'typing.Any' 'Any' + + substituteInPlace src/formatron/schemas/json_schema.py \ + --replace-fail 'from pydantic import typing' 'import typing' + ''; + build-system = [ setuptools ];