2019-07-25 22:26:49 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, email_validator
|
2021-02-28 17:12:20 +00:00
|
|
|
, fetchFromGitHub
|
2020-12-27 15:10:07 +00:00
|
|
|
, pytest-mock
|
2021-02-28 17:12:20 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, python-dotenv
|
|
|
|
, pythonOlder
|
|
|
|
, typing-extensions
|
|
|
|
, ujson
|
2019-07-25 22:26:49 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pydantic";
|
2021-02-28 17:12:20 +00:00
|
|
|
version = "1.8";
|
|
|
|
disabled = pythonOlder "3.7";
|
2019-07-25 22:26:49 +01:00
|
|
|
|
2019-12-29 18:09:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samuelcolvin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-02-28 17:12:20 +00:00
|
|
|
sha256 = "sha256-+HfnM/IrFlUyQJdiOYyaJUNenh8dLtd8CUJWSbn6hwQ=";
|
2019-07-25 22:26:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
email_validator
|
2021-02-28 17:12:20 +00:00
|
|
|
python-dotenv
|
2019-07-25 22:26:49 +01:00
|
|
|
typing-extensions
|
2021-02-28 17:12:20 +00:00
|
|
|
ujson
|
2019-07-25 22:26:49 +01:00
|
|
|
];
|
|
|
|
|
2019-12-29 18:09:43 +00:00
|
|
|
checkInputs = [
|
2020-12-27 15:10:07 +00:00
|
|
|
pytest-mock
|
2021-02-28 17:12:20 +00:00
|
|
|
pytestCheckHook
|
2019-12-29 18:09:43 +00:00
|
|
|
];
|
2019-07-25 22:26:49 +01:00
|
|
|
|
2021-02-28 17:12:20 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
2019-07-25 22:26:49 +01:00
|
|
|
'';
|
|
|
|
|
2021-02-28 17:12:20 +00:00
|
|
|
pythonImportsCheck = [ "pydantic" ];
|
|
|
|
|
2019-07-25 22:26:49 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|