From 731c09d826e888ee91d181e0621fec2addc9b4f9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 12 Nov 2021 00:28:07 +0100 Subject: [PATCH] python3Packages.aiosmtpd: enable tests --- .../python-modules/aiosmtpd/default.nix | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/aiosmtpd/default.nix b/pkgs/development/python-modules/aiosmtpd/default.nix index c204261644c5..c19e39bcd48f 100644 --- a/pkgs/development/python-modules/aiosmtpd/default.nix +++ b/pkgs/development/python-modules/aiosmtpd/default.nix @@ -1,12 +1,21 @@ -{ lib, isPy3k, fetchFromGitHub, buildPythonPackage -, attrs, atpublic }: +{ lib +, atpublic +, attrs +, buildPythonPackage +, fetchFromGitHub +, pytest-mock +, pytestCheckHook +, pythonOlder +, typing-extensions +}: buildPythonPackage rec { pname = "aiosmtpd"; version = "1.4.2"; - disabled = !isPy3k; + format = "setuptools"; + + disabled = pythonOlder "3.6"; - # Release not published to Pypi src = fetchFromGitHub { owner = "aio-libs"; repo = pname; @@ -15,19 +24,34 @@ buildPythonPackage rec { }; propagatedBuildInputs = [ - atpublic attrs + atpublic + attrs + ] ++ lib.optionals (pythonOlder "3.8") [ + typing-extensions ]; - # Tests need network access - doCheck = false; + checkInputs = [ + pytest-mock + pytestCheckHook + ]; + + disabledTests = [ + # Requires git + "test_ge_master" + # Seems to be a sandbox issue + "test_byclient" + ]; + + pythonImportsCheck = [ + "aiosmtpd" + ]; meta = with lib; { - homepage = "https://aiosmtpd.readthedocs.io/en/latest/"; description = "Asyncio based SMTP server"; + homepage = "https://aiosmtpd.readthedocs.io/"; longDescription = '' This is a server for SMTP and related protocols, similar in utility to the - standard library's smtpd.py module, but rewritten to be based on asyncio for - Python 3. + standard library's smtpd.py module. ''; license = licenses.asl20; maintainers = with maintainers; [ eadwu ];