Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / python-telegram / default.nix
blob003806712d0e0978fae695baf9b2b44f9e5c426b
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
5 , pythonOlder
6 , setuptools
7 , tdlib
8 , telegram-text
9 , pytestCheckHook
12 buildPythonPackage rec {
13   pname = "python-telegram";
14   version = "0.18.0";
15   format = "setuptools";
16   disabled = pythonOlder "3.6";
18   src = fetchFromGitHub {
19     owner = "alexander-akhmetov";
20     repo = "python-telegram";
21     rev = version;
22     hash = "sha256-2Q0nUZ2TMVWznd05+fqYojkRn4xfFZJrlqb1PMuBsAY=";
23   };
25   postPatch = ''
26     # Remove bundled libtdjson
27     rm -fr telegram/lib
29     substituteInPlace telegram/tdjson.py \
30       --replace "ctypes.util.find_library(\"tdjson\")" \
31                 "\"${tdlib}/lib/libtdjson${stdenv.hostPlatform.extensions.sharedLibrary}\""
32   '';
34   propagatedBuildInputs = [
35     setuptools
36     telegram-text
37   ];
39   nativeCheckInputs = [
40     pytestCheckHook
41   ];
43   disabledTests = [
44     "TestGetTdjsonTdlibPath"
45   ];
47   pythonImportsCheck = [
48     "telegram.client"
49   ];
51   meta = with lib; {
52     description = "Python client for the Telegram's tdlib";
53     homepage = "https://github.com/alexander-akhmetov/python-telegram";
54     license = licenses.mit;
55     maintainers = with maintainers; [ sikmir ];
56   };