Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.python-telegram-bot: 12.3.0 -> 12.7 #86652

Merged
merged 2 commits into from May 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 7 additions & 15 deletions pkgs/development/python-modules/python-telegram-bot/default.nix
Expand Up @@ -2,6 +2,7 @@
, fetchPypi
, buildPythonPackage
, certifi
, decorator
, future
, urllib3
, tornado
Expand All @@ -10,30 +11,21 @@

buildPythonPackage rec {
pname = "python-telegram-bot";
version = "12.3.0";
version = "12.7";

src = fetchPypi {
inherit pname version;
sha256 = "0yrg5342zz0hpf2pc85ffwx57msa6jpcmvvjfkzh8nh2lc98aq21";
sha256 = "1vwf4pgjrg9a6w51ds9wmzq31bmi3f7xs79gdzzfxfmqmy1hb2r1";
};

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" \
--replace "from telegram.vendor.ptb_urllib3.urllib3.fields import RequestField" "from urllib3.fields import RequestField"

touch LICENSE.dual
'';

checkInputs = [ pytest ];
propagatedBuildInputs = [ certifi future urllib3 tornado ];
propagatedBuildInputs = [ certifi future urllib3 tornado decorator ];

pipInstallFlags = "--install-option '--with-upstream-urllib3'";

# tests not included with release
doCheck = false;
veprbl marked this conversation as resolved.
Show resolved Hide resolved
pythonImportsCheck = [ "telegram" ];

meta = with stdenv.lib; {
description = "This library provides a pure Python interface for the Telegram Bot API.";
Expand Down