1{ lib
2, APScheduler
3, buildPythonPackage
4, cachetools
5, certifi
6, decorator
7, fetchPypi
8, future
9, tornado
10, urllib3
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "python-telegram-bot";
16 version = "13.14";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-6TkdQ+sRI94md6nSTqh4qdUyfWWyQZr7plP0dtJq7MM=";
24 };
25
26 propagatedBuildInputs = [
27 APScheduler
28 cachetools
29 certifi
30 decorator
31 future
32 tornado
33 urllib3
34 ];
35
36 # --with-upstream-urllib3 is not working properly
37 postPatch = ''
38 rm -r telegram/vendor
39
40 substituteInPlace requirements.txt \
41 --replace "APScheduler==3.6.3" "APScheduler" \
42 --replace "cachetools==4.2.2" "cachetools" \
43 --replace "tornado==6.1" "tornado"
44 '';
45
46 setupPyGlobalFlags = [ "--with-upstream-urllib3" ];
47
48 # tests not included with release
49 doCheck = false;
50
51 pythonImportsCheck = [
52 "telegram"
53 ];
54
55 meta = with lib; {
56 description = "Python library to interface with the Telegram Bot API";
57 homepage = "https://python-telegram-bot.org";
58 license = licenses.lgpl3Only;
59 maintainers = with maintainers; [ veprbl pingiun ];
60 };
61}