python310Packages.pytelegrambotapi: switch to pytestCheckHook

- add optional-dependencies
- normalize pname
- add changelog to meta
This commit is contained in:
Fabian Affolter 2023-01-21 12:26:13 +01:00
parent 68403fe04f
commit 6357cce27d

View file

@ -1,37 +1,87 @@
{ lib
, buildPythonPackage
, fetchPypi
, aiohttp
, requests
, aioredis
, buildPythonPackage
, coloredlogs
, fastapi
, fetchFromGitHub
, pillow
, psutil
, pytestCheckHook
, pythonOlder
, redis
, requests
, ujson
, uvicorn
, watchdog
}:
buildPythonPackage rec {
pname = "pyTelegramBotAPI";
pname = "pytelegrambotapi";
version = "4.8.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-6nfpXzq2yCVDK8pAuWzAVzr0pKn5VHqb3UH9VXhSHJ0=";
src = fetchFromGitHub {
owner = "eternnoir";
repo = "pyTelegramBotAPI";
rev = "refs/tags/${version}";
hash = "sha256-BzCFhN/4EtmoOTdQ8faa4hV5sJIuGueeKeb//z2Roig=";
};
propagatedBuildInputs = [
aiohttp
requests
fastapi
];
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";
description = "A simple, but extensible Python implementation for the Telegram Bot API";
changelog = "https://github.com/eternnoir/pyTelegramBotAPI/releases/tag/${version}";
license = licenses.gpl2Only;
maintainers = with maintainers; [ das_j ];
};