1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, ujson
6, email_validator
7, typing-extensions
8, python
9, isPy3k
10, pytest
11, pytestcov
12}:
13
14buildPythonPackage rec {
15 pname = "pydantic";
16 version = "1.5.1";
17 disabled = !isPy3k;
18
19 src = fetchFromGitHub {
20 owner = "samuelcolvin";
21 repo = pname;
22 rev = "v${version}";
23 sha256 = "0fwrx7p6d5vskg9ibganahiz9y9299idvdmzhjw62jy84gn1vrb4";
24 };
25
26 # fix tests, remove on next version bump
27 patches = [
28 (fetchpatch {
29 url = "https://github.com/samuelcolvin/pydantic/commit/a5b0e741e585040a0ab8b0be94dd9dc2dd3afcc7.patch";
30 sha256 = "0v91ac3dw23rm73370s2ns84vi0xqbfzpvj84zb7xdiicx8fhmf1";
31 })
32 ];
33
34 propagatedBuildInputs = [
35 ujson
36 email_validator
37 typing-extensions
38 ];
39
40 checkInputs = [
41 pytest
42 pytestcov
43 ];
44
45 checkPhase = ''
46 pytest
47 '';
48
49 meta = with lib; {
50 homepage = "https://github.com/samuelcolvin/pydantic";
51 description = "Data validation and settings management using Python type hinting";
52 license = licenses.mit;
53 maintainers = with maintainers; [ wd15 ];
54 };
55}