summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/denon-rs232/default.nix
blob: 29a4a1d369a000774170d8420aed85a522fdfa0b (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytest-asyncio,
  pytest-timeout,
  pytestCheckHook,
  pythonOlder,
  serialx,
  uv-build,
}:

buildPythonPackage (finalAttrs: {
  pname = "denon-rs232";
  version = "4.2.0";
  pyproject = true;

  disabled = pythonOlder "3.12";

  src = fetchFromGitHub {
    owner = "home-assistant-libs";
    repo = "denon-rs232";
    tag = finalAttrs.version;
    hash = "sha256-1GVpF4aOQ8Zzu/abghRF8WJXF+9DP+1suA0F3hy8NSo=";
  };

  build-system = [ uv-build ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail 'version = "0.0.0"' 'version = "${finalAttrs.version}"' \
      --replace-fail '"uv_build>=0.8.4,<0.9.0"' '"uv_build>=0.8.4"'
  '';

  dependencies = [ serialx ];

  nativeCheckInputs = [
    pytest-asyncio
    pytest-timeout
    pytestCheckHook
  ];

  pythonImportsCheck = [ "denon_rs232" ];

  meta = {
    description = "Async library to control Denon receivers over RS232";
    homepage = "https://github.com/home-assistant-libs/denon-rs232";
    changelog = "https://github.com/home-assistant-libs/denon-rs232/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.jamiemagee ];
  };
})