From 7e192a55e7f1da45830bda0911128cad5e3f7804 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Wed, 8 Aug 2018 15:23:27 -0400 Subject: [PATCH] pythonPackages.pytest-timeout: refactor add python 2.7 compatibiliy In version 1.3.1 of `pytest-timeout` (latest) the setup.py file is not compatible with python 2.7 and 3+ due to how `open` is called. A patch has been added that can be removed once a fix and new relase is given. --- .../python-modules/pytest-timeout/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pytest-timeout/default.nix b/pkgs/development/python-modules/pytest-timeout/default.nix index 012226de0532..45e9a4b9e477 100644 --- a/pkgs/development/python-modules/pytest-timeout/default.nix +++ b/pkgs/development/python-modules/pytest-timeout/default.nix @@ -1,5 +1,6 @@ { buildPythonPackage , fetchPypi +, fetchpatch , lib , pexpect , pytest @@ -9,10 +10,20 @@ buildPythonPackage rec { pname = "pytest-timeout"; version = "1.3.1"; + # remove after version 1.3.1 + patches = [ + (fetchpatch { + name = "fix-installation-27-3-with-encoding-issue.patch"; + url = "https://bitbucket.org/pytest-dev/pytest-timeout/commits/9de81d3fc57a71a36d418d4aa181c241a7c5350f/raw"; + sha256 = "0g081j6iyc9825f63ssmmi40rkcgk4p9vvhy9g0lqd0gc6xzwa2p"; + }) + ]; + src = fetchPypi { inherit pname version; sha256 = "4b261bec5782b603c98b4bb803484bc96bf1cdcb5480dae0999d21c7e0423a23"; }; + buildInputs = [ pytest ]; checkInputs = [ pytest pexpect ]; checkPhase = ''pytest -ra''; @@ -21,6 +32,6 @@ buildPythonPackage rec { description = "py.test plugin to abort hanging tests"; homepage = https://bitbucket.org/pytest-dev/pytest-timeout/; license = licenses.mit; - maintainers = with maintainers; [ makefu ]; + maintainers = with maintainers; [ makefu costrouc ]; }; }