19 pydantic-core = buildPythonPackage rec {
20 pname = "pydantic-core";
24 src = fetchFromGitHub {
26 repo = "pydantic-core";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-iFyCFkFzvTL6es3L96pyq/s6SS7h1mn+bS0SPcsxXxA=";
31 patches = [ ./01-remove-benchmark-flags.patch ];
33 cargoDeps = rustPlatform.fetchCargoTarball {
35 name = "${pname}-${version}";
36 hash = "sha256-4v4g9/8ZsQUqkwA29/S/BXn2Ea4eSOnMhEbhDvsGuQU=";
41 rustPlatform.cargoSetupHook
46 rustPlatform.maturinBuildHook
50 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
52 dependencies = [ typing-extensions ];
54 pythonImportsCheck = [ "pydantic_core" ];
56 # escape infinite recursion with pydantic via dirty-equals
58 passthru.tests.pytest = pydantic-core.overrideAttrs { doCheck = true; };
69 # RecursionError: maximum recursion depth exceeded while calling a Python object
74 # no point in benchmarking in nixpkgs build farm
79 changelog = "https://github.com/pydantic/pydantic-core/releases/tag/v${version}";
80 description = "Core validation logic for pydantic written in rust";
81 homepage = "https://github.com/pydantic/pydantic-core";
82 license = licenses.mit;
83 maintainers = with maintainers; [ blaggacao ];