about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/python-telegram-bot/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/python-telegram-bot/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/python-telegram-bot/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/python-telegram-bot/default.nix b/nixpkgs/pkgs/development/python-modules/python-telegram-bot/default.nix
new file mode 100644
index 000000000000..5af4383d44b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/python-telegram-bot/default.nix
@@ -0,0 +1,43 @@
+{ stdenv
+, fetchPypi
+, buildPythonPackage
+, certifi
+, future
+, urllib3
+, tornado
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "python-telegram-bot";
+  version = "11.1.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "cca4e32ebb8da7fdf35ab2fa2b3edd441211364819c5592fc253acdb7561ea5b";
+  };
+
+  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"
+
+    touch LICENSE.dual
+  '';
+
+  checkInputs = [ pytest ];
+  propagatedBuildInputs = [ certifi future urllib3 tornado ];
+
+  # tests not included with release
+  doCheck = false;
+
+  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 ];
+  };
+}