1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "pytautulli";
14 version = "23.1.1";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "ludeeus";
21 repo = pname;
22 rev = "refs/tags/${version}";
23 hash = "sha256-5wE8FjLFu1oQkVqnWsbp253dsQ1/QGWC6hHSIFwLajY=";
24 };
25
26 postPatch = ''
27 # Upstream is releasing with the help of a CI to PyPI, GitHub releases
28 # are not in their focus
29 substituteInPlace setup.py \
30 --replace 'version="main",' 'version="${version}",'
31
32 # yarl 1.9.4 requires ports to be ints
33 substituteInPlace pytautulli/models/host_configuration.py \
34 --replace "str(self.port)" "int(self.port)"
35 '';
36
37 propagatedBuildInputs = [ aiohttp ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 checkInputs = [
42 aresponses
43 pytest-asyncio
44 ];
45
46 pytestFlagsArray = [ "--asyncio-mode=auto" ];
47
48 pythonImportsCheck = [ "pytautulli" ];
49
50 meta = with lib; {
51 description = "Python module to get information from Tautulli";
52 homepage = "https://github.com/ludeeus/pytautulli";
53 changelog = "https://github.com/ludeeus/pytautulli/releases/tag/${version}";
54 license = with licenses; [ mit ];
55 maintainers = with maintainers; [ fab ];
56 };
57}