depot/third_party/nixpkgs/pkgs/development/python-modules/telethon/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

55 lines
1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, openssl
, rsa
, pyaes
, pythonOlder
, setuptools
, pytest-asyncio
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "telethon";
version = "1.26.1";
format = "pyproject";
disabled = pythonOlder "3.5";
src = fetchFromGitHub {
owner = "LonamiWebs";
repo = "Telethon";
rev = "refs/tags/v${version}";
hash = "sha256-RxnC+PVSnLeCZ1xap6n6CjpeA8Ig6oLGiB0LDxqUmsA=";
};
patchPhase = ''
substituteInPlace telethon/crypto/libssl.py --replace \
"ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'"
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
rsa
pyaes
];
nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
];
pytestFlagsArray = [
"tests/telethon"
];
meta = with lib; {
homepage = "https://github.com/LonamiWebs/Telethon";
description = "Full-featured Telegram client library for Python 3";
license = licenses.mit;
maintainers = with maintainers; [ nyanloutre ];
};
}