1{
2 lib,
3 atpublic,
4 attrs,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytest-mock,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11 typing-extensions,
12}:
13
14buildPythonPackage rec {
15 pname = "aiosmtpd";
16 version = "1.4.5";
17 pyproject = true;
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchFromGitHub {
22 owner = "aio-libs";
23 repo = "aiosmtpd";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-8nQ4BVSLYgZHRGkbujy/olV/+GABlkDhe5wef3hyQpQ=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [
31 atpublic
32 attrs
33 ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];
34
35 nativeCheckInputs = [
36 pytest-mock
37 pytestCheckHook
38 ];
39
40 # Fixes for Python 3.10 can't be applied easily, https://github.com/aio-libs/aiosmtpd/pull/294
41 doCheck = pythonOlder "3.10";
42
43 disabledTests = [
44 # Requires git
45 "test_ge_master"
46 # Seems to be a sandbox issue
47 "test_byclient"
48 ];
49
50 pythonImportsCheck = [ "aiosmtpd" ];
51
52 meta = with lib; {
53 description = "Asyncio based SMTP server";
54 mainProgram = "aiosmtpd";
55 homepage = "https://aiosmtpd.readthedocs.io/";
56 changelog = "https://github.com/aio-libs/aiosmtpd/releases/tag/v${version}";
57 longDescription = ''
58 This is a server for SMTP and related protocols, similar in utility to the
59 standard library's smtpd.py module.
60 '';
61 license = licenses.asl20;
62 maintainers = with maintainers; [ eadwu ];
63 };
64}