nixpkgs/pkgs/development/python-modules/pyTelegramBotAPI/default.nix
2024-04-09 20:05:15 +02:00

89 lines
1.5 KiB
Nix

{ lib
, aiohttp
, aioredis
, buildPythonPackage
, coloredlogs
, fastapi
, fetchFromGitHub
, hatchling
, pillow
, psutil
, pytestCheckHook
, pythonOlder
, redis
, requests
, ujson
, uvicorn
, watchdog
}:
buildPythonPackage rec {
pname = "pytelegrambotapi";
version = "4.17.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "eternnoir";
repo = "pyTelegramBotAPI";
rev = "refs/tags/${version}";
hash = "sha256-Asw6wpZs0FgsUYLVQ4u4qQgIFdvShcsN3XvgHn48cbI=";
};
build-system = [
hatchling
];
passthru.optional-dependencies = {
json = [
ujson
];
PIL = [
pillow
];
redis = [
redis
];
aioredis = [
aioredis
];
aiohttp = [
aiohttp
];
fastapi = [
fastapi
];
uvicorn = [
uvicorn
];
psutil = [
psutil
];
coloredlogs = [
coloredlogs
];
watchdog = [
watchdog
];
};
checkInputs = [
pytestCheckHook
requests
] ++ passthru.optional-dependencies.watchdog
++ passthru.optional-dependencies.aiohttp;
pythonImportsCheck = [
"telebot"
];
meta = with lib; {
description = "Python implementation for the Telegram Bot API";
homepage = "https://github.com/eternnoir/pyTelegramBotAPI";
changelog = "https://github.com/eternnoir/pyTelegramBotAPI/releases/tag/${version}";
license = licenses.gpl2Only;
maintainers = with maintainers; [ das_j ];
};
}