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 = "pvo";
16 version = "2.0.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.11";
20
21 src = fetchFromGitHub {
22 owner = "frenck";
23 repo = "python-pvoutput";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-SvsrvGwIAlj/8hdk90+rxigVrx6n3YInvF/4eux2H04=";
26 };
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 --replace "--cov" ""
33 '';
34
35 nativeBuildInputs = [
36 poetry-core
37 ];
38
39 propagatedBuildInputs = [
40 aiohttp
41 pydantic
42 yarl
43 ];
44
45 nativeCheckInputs = [
46 aresponses
47 pytest-asyncio
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [
52 "pvo"
53 ];
54
55 meta = with lib; {
56 description = "Python module to interact with the PVOutput API";
57 homepage = "https://github.com/frenck/python-pvoutput";
58 changelog = "https://github.com/frenck/python-pvoutput/releases/tag/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}