1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, poetry-core
6, aiohttp
7, yarl
8, aresponses
9, pytest-asyncio
10, pytestCheckHook
11}:
12
13buildPythonPackage rec {
14 pname = "gridnet";
15 version = "4.3.0";
16
17 disabled = pythonOlder "3.9";
18
19 format = "pyproject";
20
21 src = fetchFromGitHub {
22 owner = "klaasnicolaas";
23 repo = "python-gridnet";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-8R8vPVL1Iq0NneN8G2bjUOrEq96LW9Zk5RcWG/LSJTY=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace "0.0.0" "${version}" \
31 --replace "--cov" ""
32 '';
33
34 nativeBuildInputs = [
35 poetry-core
36 ];
37
38 propagatedBuildInputs = [
39 aiohttp
40 yarl
41 ];
42
43 nativeCheckInputs = [
44 aresponses
45 pytest-asyncio
46 pytestCheckHook
47 ];
48
49 pythonImportsCheck = [ "gridnet" ];
50
51 meta = with lib; {
52 description = "Asynchronous Python client for NET2GRID devices";
53 homepage = "https://github.com/klaasnicolaas/python-gridnet";
54 license = licenses.mit;
55 maintainers = with maintainers; [ dotlambda ];
56 };
57}