From 5738da94f4b6b2ebcfd464a7634f2a89fac377e7 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 18 Jan 2018 11:22:53 -0500 Subject: [PATCH 1/2] python-telegram-bot: init at 9.0.0 --- .../python-telegram-bot/default.nix | 21 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/python-modules/python-telegram-bot/default.nix diff --git a/pkgs/development/python-modules/python-telegram-bot/default.nix b/pkgs/development/python-modules/python-telegram-bot/default.nix new file mode 100644 index 00000000000..b9e5f2985e9 --- /dev/null +++ b/pkgs/development/python-modules/python-telegram-bot/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchPypi, buildPythonPackage, isPy3k, certifi, future }: + +buildPythonPackage rec { + pname = "python-telegram-bot"; + version = "9.0.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "0a5b4wfc6ms7kblynw2h3ygpww98kyz5n8iibqbdyykwx8xj7hzm"; + }; + + propagatedBuildInputs = [ certifi future ]; + doCheck = !isPy3k; + + meta = with stdenv.lib; { + description = "This library provides a pure Python interface for the Telegram Bot API."; + homepage = https://python-telegram-bot.org; + license = licenses.lgpl3; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5f76212bdbb..f311396d6f2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -22203,6 +22203,8 @@ EOF }; }; + python-telegram-bot = callPackage ../development/python-modules/python-telegram-bot { }; + irc = buildPythonPackage rec { name = "irc-${version}"; version = "14.2.2"; From 7a82c83c63e79b47dc6483d157d59f697874cb32 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 20 Jan 2018 18:03:35 -0500 Subject: [PATCH 2/2] python-telegram-bot: use urllib3 from nixpkgs, disable all tests properly --- .../python-telegram-bot/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/python-telegram-bot/default.nix b/pkgs/development/python-modules/python-telegram-bot/default.nix index b9e5f2985e9..d5547217910 100644 --- a/pkgs/development/python-modules/python-telegram-bot/default.nix +++ b/pkgs/development/python-modules/python-telegram-bot/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchPypi, buildPythonPackage, isPy3k, certifi, future }: +{ stdenv, fetchPypi, buildPythonPackage, certifi, future, urllib3 }: buildPythonPackage rec { pname = "python-telegram-bot"; @@ -9,8 +9,18 @@ buildPythonPackage rec { sha256 = "0a5b4wfc6ms7kblynw2h3ygpww98kyz5n8iibqbdyykwx8xj7hzm"; }; - propagatedBuildInputs = [ certifi future ]; - doCheck = !isPy3k; + prePatch = '' + rm -rf telegram/vendor + substituteInPlace telegram/utils/request.py \ + --replace "import telegram.vendor.ptb_urllib3.urllib3 as urllib3" "import urllib3 as urllib3" \ + --replace "import telegram.vendor.ptb_urllib3.urllib3.contrib.appengine as appengine" "import urllib3.contrib.appengine as appengine" \ + --replace "from telegram.vendor.ptb_urllib3.urllib3.connection import HTTPConnection" "from urllib3.connection import HTTPConnection" \ + --replace "from telegram.vendor.ptb_urllib3.urllib3.util.timeout import Timeout" "from urllib3.util.timeout import Timeout" + ''; + + propagatedBuildInputs = [ certifi future urllib3 ]; + + doCheck = false; meta = with stdenv.lib; { description = "This library provides a pure Python interface for the Telegram Bot API.";