croc: 10.1.1 -> 10.1.3 (#364662)
[NixPkgs.git] / pkgs / development / python-modules / python-telegram / default.nix
blobcfe1dbd671bfb3f546bffafb66227f801e7a6dee
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   pytestCheckHook,
7   pythonOlder,
8   setuptools-scm,
9   setuptools,
10   tdlib,
11   telegram-text,
14 buildPythonPackage rec {
15   pname = "python-telegram";
16   version = "0.19.0";
17   pyproject = true;
19   disabled = pythonOlder "3.9";
21   src = fetchFromGitHub {
22     owner = "alexander-akhmetov";
23     repo = "python-telegram";
24     rev = "refs/tags/${version}";
25     hash = "sha256-JnU59DZXpnaZXIY/apXQ2gBgiwT12rJIeVqzaP0l7Zk=";
26   };
28   postPatch = ''
29     # Remove bundled libtdjson
30     rm -fr telegram/lib
32     substituteInPlace telegram/tdjson.py \
33       --replace-fail "ctypes.util.find_library(\"tdjson\")" \
34                 "\"${tdlib}/lib/libtdjson${stdenv.hostPlatform.extensions.sharedLibrary}\""
35   '';
37   build-inputs = [ setuptools ];
39   dependencies = [
40     setuptools-scm
41     telegram-text
42   ];
44   nativeCheckInputs = [ pytestCheckHook ];
46   disabledTests = [ "TestGetTdjsonTdlibPath" ];
48   pythonImportsCheck = [ "telegram.client" ];
50   meta = with lib; {
51     description = "Python client for the Telegram's tdlib";
52     homepage = "https://github.com/alexander-akhmetov/python-telegram";
53     changelog = "https://github.com/alexander-akhmetov/python-telegram/releases/tag/${version}";
54     license = licenses.mit;
55     maintainers = with maintainers; [ sikmir ];
56   };