mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 07:34:11 +00:00
ac247ed831
Compiling pydantic with cython is supposed to give a 30-50% performance benefit. >>> import pydantic >>> pydantic.compiled True https://pydantic-docs.helpmanual.io/install/#compiled-with-cython
55 lines
989 B
Nix
55 lines
989 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, cython
|
|
, devtools
|
|
, email_validator
|
|
, fetchFromGitHub
|
|
, pytest-mock
|
|
, pytestCheckHook
|
|
, python-dotenv
|
|
, pythonOlder
|
|
, typing-extensions
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pydantic";
|
|
version = "1.9.0";
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "samuelcolvin";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-C4WP8tiMRFmkDkQRrvP3yOSM2zN8pHJmX9cdANIckpM=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cython
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
devtools
|
|
email_validator
|
|
python-dotenv
|
|
typing-extensions
|
|
];
|
|
|
|
checkInputs = [
|
|
pytest-mock
|
|
pytestCheckHook
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d)
|
|
'';
|
|
|
|
pythonImportsCheck = [ "pydantic" ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/samuelcolvin/pydantic";
|
|
description = "Data validation and settings management using Python type hinting";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ wd15 ];
|
|
};
|
|
}
|