From 5cb3501a37c2a89c2f0ce30ddb882bbc9b1da8da Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 3 May 2020 15:26:54 -0400 Subject: [PATCH 1/2] python3Packages.python-telegram-bot: mark python2 as unsupported --- pkgs/development/python-modules/python-telegram-bot/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/python-telegram-bot/default.nix b/pkgs/development/python-modules/python-telegram-bot/default.nix index 28541372c5e4..30caa0f3d6a6 100644 --- a/pkgs/development/python-modules/python-telegram-bot/default.nix +++ b/pkgs/development/python-modules/python-telegram-bot/default.nix @@ -7,11 +7,13 @@ , urllib3 , tornado , pytest +, isPy3k }: buildPythonPackage rec { pname = "python-telegram-bot"; version = "12.7"; + disabled = !isPy3k; src = fetchPypi { inherit pname version; From cc97e9d7f0d89aaf75d6d9e1394d8d7dc18f9b83 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 3 May 2020 15:27:29 -0400 Subject: [PATCH 2/2] python3Packages.python-telegram-bot: set --with-upstream-urllib3 properly, add workaround --- .../python-modules/python-telegram-bot/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/python-telegram-bot/default.nix b/pkgs/development/python-modules/python-telegram-bot/default.nix index 30caa0f3d6a6..f36f82395685 100644 --- a/pkgs/development/python-modules/python-telegram-bot/default.nix +++ b/pkgs/development/python-modules/python-telegram-bot/default.nix @@ -23,7 +23,11 @@ buildPythonPackage rec { checkInputs = [ pytest ]; propagatedBuildInputs = [ certifi future urllib3 tornado decorator ]; - pipInstallFlags = "--install-option '--with-upstream-urllib3'"; + # --with-upstream-urllib3 is not working properly + postPatch = '' + rm -rf telegram/vendor + ''; + setupPyGlobalFlags = "--with-upstream-urllib3"; # tests not included with release doCheck = false;