nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-asyncio,
9 pytest-cov-stub,
10 pytestCheckHook,
11 yarl,
12}:
13
14buildPythonPackage rec {
15 pname = "omnikinverter";
16 version = "1.0.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "klaasnicolaas";
21 repo = "python-omnikinverter";
22 tag = "v${version}";
23 hash = "sha256-W9VeRhsCXLLgOgvJcNNCGNmPvakPtKHAtwQAGtYJbcY=";
24 };
25
26 __darwinAllowLocalNetworking = true;
27
28 postPatch = ''
29 # Upstream doesn't set a version for the pyproject.toml
30 substituteInPlace pyproject.toml \
31 --replace "0.0.0" "${version}"
32 '';
33
34 nativeBuildInputs = [ poetry-core ];
35
36 propagatedBuildInputs = [
37 aiohttp
38 yarl
39 ];
40
41 nativeCheckInputs = [
42 aresponses
43 pytest-asyncio
44 pytest-cov-stub
45 pytestCheckHook
46 ];
47
48 pythonImportsCheck = [ "omnikinverter" ];
49
50 meta = {
51 description = "Python module for the Omnik Inverter";
52 homepage = "https://github.com/klaasnicolaas/python-omnikinverter";
53 changelog = "https://github.com/klaasnicolaas/python-omnikinverter/releases/tag/v${version}";
54 license = with lib.licenses; [ mit ];
55 maintainers = with lib.maintainers; [ fab ];
56 };
57}