From de6f14d3d855d331c8516d12b7288aa0ddcb27f3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 10 Mar 2022 12:51:30 +0100 Subject: [PATCH] python3Packages.pretend: enable tests --- .../python-modules/pretend/default.nix | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/pretend/default.nix b/pkgs/development/python-modules/pretend/default.nix index 87e0e6613b1d..0134b0dc36a4 100644 --- a/pkgs/development/python-modules/pretend/default.nix +++ b/pkgs/development/python-modules/pretend/default.nix @@ -1,19 +1,36 @@ -{ lib, buildPythonPackage, fetchPypi }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +}: buildPythonPackage rec { pname = "pretend"; version = "1.0.9"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "c90eb810cde8ebb06dafcb8796f9a95228ce796531bc806e794c2f4649aa1b10"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "alex"; + repo = pname; + rev = "v${version}"; + hash = "sha256-OqMfeIMFNBBLq6ejR3uOCIHZ9aA4zew7iefVlAsy1JQ="; }; - # No tests in archive - doCheck = false; + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "pretend" + ]; meta = with lib; { + description = "Module for stubbing"; homepage = "https://github.com/alex/pretend"; license = licenses.bsd3; + maintainers = with maintainers; [ ]; }; }