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 # for passthru.tests 14 django, 15 aiosmtplib, 16}: 17 18buildPythonPackage rec { 19 pname = "aiosmtpd"; 20 version = "1.4.6"; 21 pyproject = true; 22 23 disabled = pythonOlder "3.6"; 24 25 src = fetchFromGitHub { 26 owner = "aio-libs"; 27 repo = "aiosmtpd"; 28 tag = "v${version}"; 29 hash = "sha256-Ih/xbWM9O/fFQiZezydlPlIr36fLRc2lLgdfxD5Jviw="; 30 }; 31 32 nativeBuildInputs = [ setuptools ]; 33 34 propagatedBuildInputs = [ 35 atpublic 36 attrs 37 ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; 38 39 nativeCheckInputs = [ 40 pytest-mock 41 pytestCheckHook 42 ]; 43 44 # Fixes for Python 3.10 can't be applied easily, https://github.com/aio-libs/aiosmtpd/pull/294 45 doCheck = pythonOlder "3.10"; 46 47 disabledTests = [ 48 # Requires git 49 "test_ge_master" 50 # Seems to be a sandbox issue 51 "test_byclient" 52 ]; 53 54 pythonImportsCheck = [ "aiosmtpd" ]; 55 56 passthru.tests = { 57 inherit django aiosmtplib; 58 }; 59 60 meta = with lib; { 61 description = "Asyncio based SMTP server"; 62 mainProgram = "aiosmtpd"; 63 homepage = "https://aiosmtpd.readthedocs.io/"; 64 changelog = "https://github.com/aio-libs/aiosmtpd/releases/tag/v${version}"; 65 longDescription = '' 66 This is a server for SMTP and related protocols, similar in utility to the 67 standard library's smtpd.py module. 68 ''; 69 license = licenses.asl20; 70 maintainers = with maintainers; [ eadwu ]; 71 }; 72}