2023-08-08 09:22:05 -07:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
2023-07-09 18:01:02 -05:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cargo,
|
|
|
|
rustPlatform,
|
|
|
|
rustc,
|
2023-08-08 09:22:05 -07:00
|
|
|
libiconv,
|
2023-07-09 18:01:02 -05:00
|
|
|
typing-extensions,
|
|
|
|
pytestCheckHook,
|
|
|
|
hypothesis,
|
|
|
|
pytest-timeout,
|
|
|
|
pytest-mock,
|
|
|
|
dirty-equals,
|
2025-03-31 03:40:29 +02:00
|
|
|
pydantic,
|
2023-07-09 18:01:02 -05:00
|
|
|
}:
|
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
let
|
|
|
|
pydantic-core = buildPythonPackage rec {
|
|
|
|
pname = "pydantic-core";
|
2025-03-31 03:40:29 +02:00
|
|
|
version = "2.33.0";
|
2024-03-09 14:24:19 +09:00
|
|
|
pyproject = true;
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pydantic";
|
|
|
|
repo = "pydantic-core";
|
2025-01-03 21:24:13 +01:00
|
|
|
tag = "v${version}";
|
2025-03-31 03:40:29 +02:00
|
|
|
hash = "sha256-F+ie8cJ1xl8i3kQSH6H24Vi5KSkRGjX/bXIfzY+ZayM=";
|
2023-09-15 14:06:46 +02:00
|
|
|
};
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2025-01-23 16:07:59 +01:00
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
2025-05-30 15:56:49 +02:00
|
|
|
inherit pname version src;
|
2025-03-31 03:40:29 +02:00
|
|
|
hash = "sha256-bGhS36Fc7LUdpTHsIM1zn1vX2T/OX+fPewLxLGSZRrk=";
|
2023-09-15 14:06:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cargo
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustc
|
2024-03-09 14:24:19 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
build-system = [
|
|
|
|
rustPlatform.maturinBuildHook
|
2023-09-15 14:06:46 +02:00
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
|
|
|
|
|
|
|
dependencies = [ typing-extensions ];
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
pythonImportsCheck = [ "pydantic_core" ];
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
# escape infinite recursion with pydantic via dirty-equals
|
|
|
|
doCheck = false;
|
|
|
|
passthru.tests.pytest = pydantic-core.overrideAttrs { doCheck = true; };
|
2023-08-08 09:22:05 -07:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
hypothesis
|
|
|
|
pytest-timeout
|
|
|
|
dirty-equals
|
|
|
|
pytest-mock
|
|
|
|
];
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
disabledTests = [
|
|
|
|
# RecursionError: maximum recursion depth exceeded while calling a Python object
|
|
|
|
"test_recursive"
|
|
|
|
];
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
disabledTestPaths = [
|
|
|
|
# no point in benchmarking in nixpkgs build farm
|
|
|
|
"tests/benchmarks"
|
|
|
|
];
|
2023-07-09 18:01:02 -05:00
|
|
|
|
2023-09-15 14:06:46 +02:00
|
|
|
meta = with lib; {
|
2023-12-03 14:55:08 +01:00
|
|
|
changelog = "https://github.com/pydantic/pydantic-core/releases/tag/v${version}";
|
2023-09-15 14:06:46 +02:00
|
|
|
description = "Core validation logic for pydantic written in rust";
|
|
|
|
homepage = "https://github.com/pydantic/pydantic-core";
|
|
|
|
license = licenses.mit;
|
2025-03-31 03:40:29 +02:00
|
|
|
maintainers = pydantic.meta.maintainers;
|
2023-09-15 14:06:46 +02:00
|
|
|
};
|
2023-07-09 18:01:02 -05:00
|
|
|
};
|
2023-09-15 14:06:46 +02:00
|
|
|
in
|
|
|
|
pydantic-core
|