summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/aiovban/default.nix
blob: 5f56f697b3e947168a894e07d16005d96ac7aa79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  aiovban-pyaudio,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  textual,
  uv-build,
  music-assistant,
}:

buildPythonPackage (finalAttrs: {
  pname = "aiovban";
  version = "1.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "wmbest2";
    repo = "aiovban";
    tag = "v${finalAttrs.version}";
    hash = "sha256-yPp4+aQGJISTIFI/OoO7+mAR8daEytxrQn21SsFWEyc=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "uv_build>=0.10.0,<0.11.0" "uv_build"
  '';

  build-system = [ uv-build ];

  dependencies = [ textual ];

  # avoid infinite recursion with aiovban-pyaudio
  doCheck = false;

  nativeCheckInputs = [
    aiovban-pyaudio
    pytestCheckHook
  ]
  ++ aiovban-pyaudio.optional-dependencies.cli;

  pythonImportsCheck = [
    "aiovban"
  ];

  passthru.tests = finalAttrs.finalPackage.overrideAttrs (_: {
    doInstallCheck = true;
  });

  meta = {
    changelog = "https://github.com/wmbest2/aiovban/releases/tag/${finalAttrs.src.tag}";
    description = "Asyncio VBAN Protocol Wrapper";
    homepage = "https://github.com/wmbest2/aiovban";
    license = lib.licenses.mit;
    inherit (music-assistant.meta) maintainers;
  };
})