From 52f97ffab2bb2c67402728ddaff3bf0431f1a63a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 25 Feb 2022 13:37:54 +0100 Subject: [PATCH] python3Packages.python-twitter: rename requests-oauthlib --- .../python-modules/python-twitter/default.nix | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/python-twitter/default.nix b/pkgs/development/python-modules/python-twitter/default.nix index f6814a8d0fda..79d262a8b02a 100644 --- a/pkgs/development/python-modules/python-twitter/default.nix +++ b/pkgs/development/python-modules/python-twitter/default.nix @@ -2,20 +2,23 @@ , buildPythonPackage , fetchFromGitHub , fetchpatch -, pytest-runner +, filetype , future -, requests -, responses -, requests_oauthlib -, pytest , hypothesis +, pytestCheckHook +, pythonOlder +, requests +, requests-oauthlib +, responses }: buildPythonPackage rec { pname = "python-twitter"; version = "3.5"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; - # No tests in PyPi Tarball src = fetchFromGitHub { owner = "bear"; repo = pname; @@ -31,12 +34,30 @@ buildPythonPackage rec { }) ]; - nativeBuildInputs = [ pytest-runner ]; - propagatedBuildInputs = [ future requests requests_oauthlib ]; - checkInputs = [ pytest responses hypothesis ]; + propagatedBuildInputs = [ + filetype + future + requests + requests-oauthlib + ]; + + checkInputs = [ + pytestCheckHook + responses + hypothesis + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "'pytest-runner'" "" + ''; + + pythonImportsCheck = [ + "twitter" + ]; meta = with lib; { - description = "A Python wrapper around the Twitter API"; + description = "Python wrapper around the Twitter API"; homepage = "https://github.com/bear/python-twitter"; license = licenses.asl20; maintainers = [ maintainers.marsam ];