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 = "pytautulli";
22 tag = 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-fail 'version="main",' 'version="${version}",'
31
32 # yarl 1.9.4 requires ports to be ints
33 substituteInPlace pytautulli/models/host_configuration.py \
34 --replace-fail "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 disabledTests = [
47 # api url mismatch (port missing)
48 "test_api_url"
49 ];
50
51 pythonImportsCheck = [ "pytautulli" ];
52
53 meta = with lib; {
54 description = "Python module to get information from Tautulli";
55 homepage = "https://github.com/ludeeus/pytautulli";
56 changelog = "https://github.com/ludeeus/pytautulli/releases/tag/${version}";
57 license = with licenses; [ mit ];
58 maintainers = with maintainers; [ fab ];
59 };
60}