1{ lib
2, aiohttp
3, aresponses
4, backoff
5, buildPythonPackage
6, fetchFromGitHub
7, fetchpatch
8, poetry-core
9, pytest-aiohttp
10, pytest-asyncio
11, pytestCheckHook
12, pythonOlder
13}:
14
15buildPythonPackage rec {
16 pname = "pyopenuv";
17 version = "2023.02.0";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "bachya";
24 repo = pname;
25 rev = "refs/tags/${version}";
26 hash = "sha256-EiTTck6hmOGSQ7LyZsbhnH1zgkH8GccejLdJaH2m0F8=";
27 };
28
29 patches = [
30 # Remove asynctest, https://github.com/bachya/pyopenuv/pull/108
31 (fetchpatch {
32 name = "remove-asynctest.patch";
33 url = "https://github.com/bachya/pyopenuv/commit/af15736b0d82ef811c3f380f5da32007752644fe.patch";
34 hash = "sha256-5uQS3DoM91mhfyxLTNii3JBxwXIDK4/GwtadkVagjuw=";
35 })
36 ];
37
38 nativeBuildInputs = [
39 poetry-core
40 ];
41
42 propagatedBuildInputs = [
43 aiohttp
44 backoff
45 ];
46
47 nativeCheckInputs = [
48 aresponses
49 pytest-asyncio
50 pytest-aiohttp
51 pytestCheckHook
52 ];
53
54 disabledTestPaths = [
55 # Ignore the examples as they are prefixed with test_
56 "examples/"
57 ];
58
59 pythonImportsCheck = [
60 "pyopenuv"
61 ];
62
63 meta = with lib; {
64 description = "Python API to retrieve data from openuv.io";
65 homepage = "https://github.com/bachya/pyopenuv";
66 changelog = "https://github.com/bachya/pyopenuv/releases/tag/${version}";
67 license = with licenses; [ mit ];
68 maintainers = with maintainers; [ fab ];
69 };
70}