evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / flux-led / default.nix
blob79fd9f10f26642bcc72ffd093b95d80101edc75d
2   lib,
3   async-timeout,
4   buildPythonPackage,
5   fetchFromGitHub,
6   webcolors,
7   pythonOlder,
8   pytestCheckHook,
9   setuptools,
12 buildPythonPackage rec {
13   pname = "flux-led";
14   version = "1.0.4";
15   pyproject = true;
17   disabled = pythonOlder "3.8";
19   src = fetchFromGitHub {
20     owner = "Danielhiversen";
21     repo = "flux_led";
22     rev = "refs/tags/${version}";
23     hash = "sha256-enYo2hZ1C8jqO+8xZhSmIOJQAyrtVUJ9S/e2Bxzhv0I=";
24   };
26   postPatch = ''
27     substituteInPlace setup.py \
28       --replace-fail '"pytest-runner>=5.2",' ""
29     # webcolors API change, https://github.com/Danielhiversen/flux_led/issues/401
30     substituteInPlace flux_led/utils.py \
31       --replace-fail "CSS2_HEX_TO_NAMES.values()" 'names("css2")' \
32       --replace-fail "CSS21_HEX_TO_NAMES.values()" 'names("css21")' \
33       --replace-fail "CSS3_HEX_TO_NAMES.values()" 'names("css3")' \
34       --replace-fail "HTML4_HEX_TO_NAMES.values()" 'names("html4")'
35   '';
37   build-system = [ setuptools ];
39   dependencies = [
40     async-timeout
41     webcolors
42   ];
44   nativeCheckInputs = [ pytestCheckHook ];
46   pytestFlagsArray = [ "tests.py" ];
48   pythonImportsCheck = [ "flux_led" ];
50   # disabledTests = [
51   #   # AttributeError: module 'webcolors' has no attribute 'CSS2_HEX_TO_NAMES'
52   #   "test_get_color_names_list"
53   # ];
55   meta = with lib; {
56     description = "Python library to communicate with the flux_led smart bulbs";
57     homepage = "https://github.com/Danielhiversen/flux_led";
58     changelog = "https://github.com/Danielhiversen/flux_led/releases/tag/${version}";
59     license = licenses.lgpl3Plus;
60     maintainers = with maintainers; [ colemickens ];
61     platforms = platforms.linux;
62     mainProgram = "flux_led";
63   };