2018-10-25 19:13:59 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, certifi
|
|
|
|
, future
|
|
|
|
, urllib3
|
|
|
|
, tornado
|
|
|
|
, pytest
|
|
|
|
}:
|
2018-01-18 16:22:53 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-telegram-bot";
|
2019-10-24 07:47:46 +01:00
|
|
|
version = "12.2.0";
|
2018-01-18 16:22:53 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-10-24 07:47:46 +01:00
|
|
|
sha256 = "346d42771c2b23384c59f5f41e05bd7e801a0ce118d8dcb95209bb73d5f694c5";
|
2018-01-18 16:22:53 +00:00
|
|
|
};
|
|
|
|
|
2018-01-20 23:03:35 +00:00
|
|
|
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"
|
2018-10-25 19:13:59 +01:00
|
|
|
|
|
|
|
touch LICENSE.dual
|
2018-01-20 23:03:35 +00:00
|
|
|
'';
|
|
|
|
|
2018-10-25 19:13:59 +01:00
|
|
|
checkInputs = [ pytest ];
|
|
|
|
propagatedBuildInputs = [ certifi future urllib3 tornado ];
|
2018-01-20 23:03:35 +00:00
|
|
|
|
2018-10-25 19:13:59 +01:00
|
|
|
# tests not included with release
|
2018-01-20 23:03:35 +00:00
|
|
|
doCheck = false;
|
2018-01-18 16:22:53 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|