1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytestCheckHook,
8 pytest-asyncio,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "pyuptimerobot";
14 version = "23.1.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "ludeeus";
21 repo = "pyuptimerobot";
22 tag = version;
23 hash = "sha256-hy/hmXxxEb44X8JUszoA1YF/41y7GkQqC4uS+Pax6WA=";
24 };
25
26 postPatch = ''
27 # Upstream doesn't set version in the repo
28 substituteInPlace setup.py \
29 --replace 'version="main",' 'version="${version}",'
30 '';
31
32 propagatedBuildInputs = [ aiohttp ];
33
34 nativeCheckInputs = [
35 aresponses
36 pytestCheckHook
37 pytest-asyncio
38 ];
39
40 pythonImportsCheck = [ "pyuptimerobot" ];
41
42 meta = with lib; {
43 description = "Python API wrapper for Uptime Robot";
44 homepage = "https://github.com/ludeeus/pyuptimerobot";
45 changelog = "https://github.com/ludeeus/pyuptimerobot/releases/tag/${version}";
46 license = licenses.mit;
47 maintainers = with maintainers; [ fab ];
48 };
49}