1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, poetry-core
7, pydantic
8, pytest-asyncio
9, pytestCheckHook
10, pythonOlder
11, yarl
12}:
13
14buildPythonPackage rec {
15 pname = "elgato";
16 version = "2.2.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "frenck";
23 repo = "python-elgato";
24 rev = "v${version}";
25 sha256 = "sha256-xsIglJSnvtd3NKqwoRAonPRN+C9KWyar0mrYcC3hPpw=";
26 };
27
28 nativeBuildInputs = [
29 poetry-core
30 ];
31
32 propagatedBuildInputs = [
33 aiohttp
34 pydantic
35 yarl
36 ];
37
38 checkInputs = [
39 aresponses
40 pytest-asyncio
41 pytestCheckHook
42 ];
43
44 postPatch = ''
45 # Upstream doesn't set a version for the pyproject.toml
46 substituteInPlace pyproject.toml \
47 --replace "0.0.0" "${version}" \
48 --replace "--cov" ""
49 '';
50
51 pythonImportsCheck = [
52 "elgato"
53 ];
54
55 meta = with lib; {
56 description = "Python client for Elgato Key Lights";
57 homepage = "https://github.com/frenck/python-elgato";
58 license = with licenses; [ mit ];
59 maintainers = with maintainers; [ fab ];
60 };
61}