2019-07-25 23:26:49 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-12-29 19:09:43 +01:00
|
|
|
, fetchFromGitHub
|
2020-06-15 15:29:57 +02:00
|
|
|
, fetchpatch
|
2019-07-25 23:26:49 +02:00
|
|
|
, ujson
|
|
|
|
, email_validator
|
|
|
|
, typing-extensions
|
|
|
|
, python
|
|
|
|
, isPy3k
|
2019-12-29 19:09:43 +01:00
|
|
|
, pytest
|
|
|
|
, pytestcov
|
2019-07-25 23:26:49 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pydantic";
|
2020-05-09 12:29:10 +02:00
|
|
|
version = "1.5.1";
|
2019-07-25 23:26:49 +02:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2019-12-29 19:09:43 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samuelcolvin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-05-09 12:29:10 +02:00
|
|
|
sha256 = "0fwrx7p6d5vskg9ibganahiz9y9299idvdmzhjw62jy84gn1vrb4";
|
2019-07-25 23:26:49 +02:00
|
|
|
};
|
|
|
|
|
2020-06-15 15:29:57 +02:00
|
|
|
# fix tests, remove on next version bump
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/samuelcolvin/pydantic/commit/a5b0e741e585040a0ab8b0be94dd9dc2dd3afcc7.patch";
|
|
|
|
sha256 = "0v91ac3dw23rm73370s2ns84vi0xqbfzpvj84zb7xdiicx8fhmf1";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-07-25 23:26:49 +02:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
ujson
|
|
|
|
email_validator
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2019-12-29 19:09:43 +01:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
pytestcov
|
|
|
|
];
|
2019-07-25 23:26:49 +02:00
|
|
|
|
2019-12-29 19:09:43 +01:00
|
|
|
checkPhase = ''
|
|
|
|
pytest
|
2019-07-25 23:26:49 +02: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 ];
|
|
|
|
};
|
|
|
|
}
|