From fd2d5dd3398acc4b34540250a8339c1207b3cbf8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 10 Oct 2021 05:05:31 +0200 Subject: [PATCH] python3Packages.FormEncode: fix tests, refactor --- .../python-modules/FormEncode/default.nix | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/FormEncode/default.nix b/pkgs/development/python-modules/FormEncode/default.nix index 70e7e09bbbea..08bcbaa6516a 100644 --- a/pkgs/development/python-modules/FormEncode/default.nix +++ b/pkgs/development/python-modules/FormEncode/default.nix @@ -1,4 +1,14 @@ -{ lib, buildPythonPackage, fetchPypi, dnspython, pycountry, nose, setuptools-scm, six, isPy27 }: +{ lib +, buildPythonPackage +, isPy27 +, fetchPypi +, nose +, setuptools-scm +, six +, dnspython +, pycountry +, pytestCheckHook +}: buildPythonPackage rec { pname = "FormEncode"; @@ -12,23 +22,29 @@ buildPythonPackage rec { }; postPatch = '' - sed -i 's/setuptools_scm_git_archive//' setup.py - sed -i 's/use_scm_version=.*,/version="${version}",/' setup.py + sed -i '/setuptools_scm_git_archive/d' setup.py ''; nativeBuildInputs = [ setuptools-scm ]; + propagatedBuildInputs = [ six ]; - checkInputs = [ dnspython pycountry nose ]; + checkInputs = [ + dnspython + pycountry + pytestCheckHook + ]; - preCheck = '' - # requires dns resolving - sed -i 's/test_unicode_ascii_subgroup/noop/' formencode/tests/test_email.py - ''; + disabledTests = [ + # requires network for DNS resolution + "test_doctests" + "test_unicode_ascii_subgroup" + ]; meta = with lib; { description = "FormEncode validates and converts nested structures"; homepage = "http://formencode.org"; license = licenses.mit; + maintainers = with maintainers; [ ]; }; }