1{ lib
2, aioredis
3, aiosmtplib
4, blinker
5, buildPythonPackage
6, email-validator
7, fakeredis
8, fastapi
9, fetchFromGitHub
10, httpx
11, jinja2
12, poetry-core
13, pydantic
14, pytest-asyncio
15, pytestCheckHook
16, python-multipart
17, pythonOlder
18}:
19
20buildPythonPackage rec {
21 pname = "fastapi-mail";
22 version = "1.2.8";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "sabuhish";
29 repo = pname;
30 rev = "refs/tags/${version}";
31 hash = "sha256-9u7+TYO0TmzyLcCxZL86ibC3hNH5b722t5fWimRHaW0=";
32 };
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace 'version = "1.2.2"' 'version = "${version}"' \
37 --replace 'aiosmtplib = "^2.0"' 'aiosmtplib = "*"' \
38 --replace 'pydantic = "^1.8"' 'pydantic = "*"' \
39 --replace 'starlette = "^0.22.0"' 'starlette = "*"' \
40 --replace 'black = "^22.12.0"' ""
41 '';
42
43 nativeBuildInputs = [
44 poetry-core
45 ];
46
47 propagatedBuildInputs = [
48 aioredis
49 aiosmtplib
50 blinker
51 email-validator
52 fakeredis
53 fastapi
54 httpx
55 jinja2
56 pydantic
57 python-multipart
58 ];
59
60 nativeCheckInputs = [
61 pytest-asyncio
62 pytestCheckHook
63 ];
64
65 disabledTests = [
66 # Tests require access to /etc/resolv.conf
67 "test_default_checker"
68 "test_redis_checker"
69 ];
70
71 pythonImportsCheck = [
72 "fastapi_mail"
73 ];
74
75 meta = with lib; {
76 description = "Module for sending emails and attachments";
77 homepage = "https://github.com/sabuhish/fastapi-mail";
78 changelog = "https://github.com/sabuhish/fastapi-mail/releases/tag/${version}";
79 license = with licenses; [ mit ];
80 maintainers = with maintainers; [ fab ];
81 };
82}