1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 aiohttp,
7 yarl,
8 aresponses,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "twentemilieu";
16 version = "2.0.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.11";
20
21 src = fetchFromGitHub {
22 owner = "frenck";
23 repo = "python-twentemilieu";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-0rs+nBJfyXRj/3n/G2JzUDXaiIYZmWsoIcgLoWKhlV4=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace "--cov" "" \
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 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "twentemilieu" ];
48
49 meta = with lib; {
50 description = "Python client for Twente Milieu";
51 homepage = "https://github.com/frenck/python-twentemilieu";
52 changelog = "https://github.com/frenck/python-twentemilieu/releases/tag/v${version}";
53 license = with licenses; [ mit ];
54 maintainers = with maintainers; [ fab ];
55 };
56}