nixpkgs/pkgs/development/python-modules/python-telegram/default.nix
adisbladis 02dab4ab5c python3.pkgs.*: Explicitly pass buildPythonPackage format parameter
Long term we should move everything over to `pyproject = true`, but in
the mean time we can work towards deprecating the implicit `format` paremeter.

cc https://github.com/NixOS/nixpkgs/issues/253154
cc @mweinelt @figsoda
2023-12-07 17:46:49 +01:00

58 lines
1.1 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, setuptools
, tdlib
, telegram-text
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "python-telegram";
version = "0.18.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "alexander-akhmetov";
repo = "python-telegram";
rev = version;
hash = "sha256-2Q0nUZ2TMVWznd05+fqYojkRn4xfFZJrlqb1PMuBsAY=";
};
postPatch = ''
# Remove bundled libtdjson
rm -fr telegram/lib
substituteInPlace telegram/tdjson.py \
--replace "ctypes.util.find_library(\"tdjson\")" \
"\"${tdlib}/lib/libtdjson${stdenv.hostPlatform.extensions.sharedLibrary}\""
'';
propagatedBuildInputs = [
setuptools
telegram-text
];
nativeCheckInputs = [
pytestCheckHook
];
disabledTests = [
"TestGetTdjsonTdlibPath"
];
pythonImportsCheck = [
"telegram.client"
];
meta = with lib; {
description = "Python client for the Telegram's tdlib";
homepage = "https://github.com/alexander-akhmetov/python-telegram";
license = licenses.mit;
maintainers = with maintainers; [ sikmir ];
};
}