depot/third_party/nixpkgs/pkgs/development/python-modules/pytautulli/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

57 lines
1.3 KiB
Nix

{
lib,
aiohttp,
aresponses,
buildPythonPackage,
fetchFromGitHub,
pytest-asyncio,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "pytautulli";
version = "23.1.1";
format = "setuptools";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "ludeeus";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-5wE8FjLFu1oQkVqnWsbp253dsQ1/QGWC6hHSIFwLajY=";
};
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}",'
# yarl 1.9.4 requires ports to be ints
substituteInPlace pytautulli/models/host_configuration.py \
--replace "str(self.port)" "int(self.port)"
'';
propagatedBuildInputs = [ aiohttp ];
nativeCheckInputs = [ pytestCheckHook ];
checkInputs = [
aresponses
pytest-asyncio
];
pytestFlagsArray = [ "--asyncio-mode=auto" ];
pythonImportsCheck = [ "pytautulli" ];
meta = with lib; {
description = "Python module to get information from Tautulli";
homepage = "https://github.com/ludeeus/pytautulli";
changelog = "https://github.com/ludeeus/pytautulli/releases/tag/${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}