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