biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pydantic-core / default.nix
blob77d3395258780b2ca9d23b59b20f3bc9c61fdb0d
2   stdenv,
3   lib,
4   buildPythonPackage,
5   fetchFromGitHub,
6   cargo,
7   rustPlatform,
8   rustc,
9   libiconv,
10   typing-extensions,
11   pytestCheckHook,
12   hypothesis,
13   pytest-timeout,
14   pytest-mock,
15   dirty-equals,
18 let
19   pydantic-core = buildPythonPackage rec {
20     pname = "pydantic-core";
21     version = "2.20.1";
22     pyproject = true;
24     src = fetchFromGitHub {
25       owner = "pydantic";
26       repo = "pydantic-core";
27       rev = "refs/tags/v${version}";
28       hash = "sha256-iFyCFkFzvTL6es3L96pyq/s6SS7h1mn+bS0SPcsxXxA=";
29     };
31     patches = [ ./01-remove-benchmark-flags.patch ];
33     cargoDeps = rustPlatform.fetchCargoTarball {
34       inherit src;
35       name = "${pname}-${version}";
36       hash = "sha256-4v4g9/8ZsQUqkwA29/S/BXn2Ea4eSOnMhEbhDvsGuQU=";
37     };
39     nativeBuildInputs = [
40       cargo
41       rustPlatform.cargoSetupHook
42       rustc
43     ];
45     build-system = [
46       rustPlatform.maturinBuildHook
47       typing-extensions
48     ];
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
57     doCheck = false;
58     passthru.tests.pytest = pydantic-core.overrideAttrs { doCheck = true; };
60     nativeCheckInputs = [
61       pytestCheckHook
62       hypothesis
63       pytest-timeout
64       dirty-equals
65       pytest-mock
66     ];
68     disabledTests = [
69       # RecursionError: maximum recursion depth exceeded while calling a Python object
70       "test_recursive"
71     ];
73     disabledTestPaths = [
74       # no point in benchmarking in nixpkgs build farm
75       "tests/benchmarks"
76     ];
78     meta = with lib; {
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 ];
84     };
85   };
87 pydantic-core