about summary refs log tree commit diff
path: root/pkgs/development/python-modules/esphome-dashboard-api/default.nix
blob: 9f45c3460ee925b5784dca79ce86c28b245bd166 (plain) (blame)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  wheel,
  aiohttp,
}:

buildPythonPackage rec {
  pname = "esphome-dashboard-api";
  version = "1.2.3";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "esphome";
    repo = "dashboard-api";
    rev = "refs/tags/${version}";
    hash = "sha256-RFfS0xzRXoM6ETXmviiMPxffPzspjTqpkvHOlTJXN9g=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "setuptools~=65.6" "setuptools" \
      --replace "wheel~=0.37.1" "wheel"
  '';

  nativeBuildInputs = [
    setuptools
    wheel
  ];

  propagatedBuildInputs = [ aiohttp ];

  doCheck = false; # no tests

  pythonImportsCheck = [ "esphome_dashboard_api" ];

  meta = with lib; {
    description = "API to interact with ESPHome Dashboard";
    homepage = "https://github.com/esphome/dashboard-api";
    changelog = "https://github.com/esphome/dashboard-api/releases/tag/${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
  };
}