2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
aresponses,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2021-10-14 00:43:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytautulli";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "23.1.1";
|
2021-10-14 00:43:12 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ludeeus";
|
|
|
|
repo = pname;
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-5wE8FjLFu1oQkVqnWsbp253dsQ1/QGWC6hHSIFwLajY=";
|
2021-10-14 00:43:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Upstream is releasing with the help of a CI to PyPI, GitHub releases
|
|
|
|
# are not in their focus
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'version="main",' 'version="${version}",'
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# yarl 1.9.4 requires ports to be ints
|
|
|
|
substituteInPlace pytautulli/models/host_configuration.py \
|
|
|
|
--replace "str(self.port)" "int(self.port)"
|
2021-10-14 00:43:12 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ aiohttp ];
|
2021-10-14 00:43:12 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
checkInputs = [
|
|
|
|
aresponses
|
|
|
|
pytest-asyncio
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "--asyncio-mode=auto" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pytautulli" ];
|
2021-10-14 00:43:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to get information from Tautulli";
|
|
|
|
homepage = "https://github.com/ludeeus/pytautulli";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/ludeeus/pytautulli/releases/tag/${version}";
|
2021-10-14 00:43:12 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|