1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 poetry-core,
7 aiodns,
8 aiohttp,
9 awesomeversion,
10 backoff,
11 cachetools,
12 mashumaro,
13 orjson,
14 pycountry,
15 yarl,
16 aresponses,
17 pytest-asyncio,
18 pytest-cov-stub,
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "radios";
24 version = "0.3.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.11";
28
29 src = fetchFromGitHub {
30 owner = "frenck";
31 repo = "python-radios";
32 tag = "v${version}";
33 hash = "sha256-GXiLwwjZ/pN3HquzLLWq/2EfhmrJyCXq0sovIGRB3uQ=";
34 };
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
39 '';
40
41 build-system = [
42 poetry-core
43 ];
44
45 dependencies = [
46 aiodns
47 aiohttp
48 awesomeversion
49 backoff
50 cachetools
51 mashumaro
52 orjson
53 pycountry
54 yarl
55 ];
56
57 nativeCheckInputs = [
58 aresponses
59 pytest-asyncio
60 pytest-cov-stub
61 pytestCheckHook
62 ];
63
64 pythonImportsCheck = [ "radios" ];
65
66 __darwinAllowLocalNetworking = true;
67
68 meta = with lib; {
69 changelog = "https://github.com/frenck/python-radios/releases/tag/v${version}";
70 description = "Asynchronous Python client for the Radio Browser API";
71 homepage = "https://github.com/frenck/python-radios";
72 license = licenses.mit;
73 maintainers = with maintainers; [ dotlambda ];
74 };
75}