2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-04-21 15:54:59 +00:00
|
|
|
, cython_0
|
2024-01-13 08:15:51 +00:00
|
|
|
, email-validator
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytest-mock
|
2024-04-21 15:54:59 +00:00
|
|
|
, pytest7CheckHook
|
2024-01-13 08:15:51 +00:00
|
|
|
, python-dotenv
|
2024-02-29 20:09:43 +00:00
|
|
|
, pythonAtLeast
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
|
|
|
, typing-extensions
|
|
|
|
, libxcrypt
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pydantic";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.10.14";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pydantic";
|
|
|
|
repo = "pydantic";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-tcaHSPZggVwyzCgDmwOgcGqUmUrJOmkdSNudJTFQ3bc=";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
2024-04-21 15:54:59 +00:00
|
|
|
cython_0
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals (pythonOlder "3.9") [
|
|
|
|
libxcrypt
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
dotenv = [
|
|
|
|
python-dotenv
|
|
|
|
];
|
|
|
|
email = [
|
|
|
|
email-validator
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytest-mock
|
2024-04-21 15:54:59 +00:00
|
|
|
pytest7CheckHook
|
2024-01-13 08:15:51 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# https://github.com/pydantic/pydantic/issues/4817
|
|
|
|
"-W" "ignore::pytest.PytestReturnNotNoneWarning"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# depends on distuils
|
|
|
|
"test_cython_function_untouched"
|
|
|
|
# AssertionError on exact types and wording
|
|
|
|
"test_model_subclassing_abstract_base_classes_without_implementation_raises_exception"
|
|
|
|
"test_partial_specification_name"
|
|
|
|
"test_secretfield"
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pydantic" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Data validation and settings management using Python type hinting";
|
|
|
|
homepage = "https://github.com/pydantic/pydantic";
|
|
|
|
changelog = "https://github.com/pydantic/pydantic/blob/v${version}/HISTORY.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|