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.3.1";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchFromGitHub {
28 owner = "sabuhish";
29 repo = pname;
30 rev = "refs/tags/${version}";
31 hash = "sha256-m8d4y75+mSh9A+YVaV/yZhN3ckOe2mV1jdtfeNFtU/w=";
32 };
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace 'version = "1.2.5"' 'version = "${version}"' \
37 --replace 'aiosmtplib = "^2.0"' 'aiosmtplib = "*"' \
38 --replace 'pydantic = "^1.8"' 'pydantic = "*"' \
39 '';
40
41 nativeBuildInputs = [
42 poetry-core
43 ];
44
45 propagatedBuildInputs = [
46 aioredis
47 aiosmtplib
48 blinker
49 email-validator
50 fakeredis
51 fastapi
52 httpx
53 jinja2
54 pydantic
55 python-multipart
56 ];
57
58 nativeCheckInputs = [
59 pytest-asyncio
60 pytestCheckHook
61 ];
62
63 disabledTests = [
64 # Tests require access to /etc/resolv.conf
65 "test_default_checker"
66 "test_redis_checker"
67 ];
68
69 pythonImportsCheck = [
70 "fastapi_mail"
71 ];
72
73 meta = with lib; {
74 description = "Module for sending emails and attachments";
75 homepage = "https://github.com/sabuhish/fastapi-mail";
76 changelog = "https://github.com/sabuhish/fastapi-mail/releases/tag/${version}";
77 license = with licenses; [ mit ];
78 maintainers = with maintainers; [ fab ];
79 };
80}