1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, anyio
6, asyncio-throttle
7, dataclasses
8, ircstates
9, async_stagger
10, async-timeout
11, python
12}:
13
14buildPythonPackage rec {
15 pname = "ircrobots";
16 version = "0.3.8";
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "jesopo";
21 repo = pname;
22 rev = "v${version}";
23 sha256 = "06q86dqllxvi3nssfplmjk9yxaybighwh87lrxfpfhl8yy4z68jz";
24 };
25
26 postPatch = ''
27 # too specific pins https://github.com/jesopo/ircrobots/issues/3
28 sed -iE 's/anyio.*/anyio/' requirements.txt
29 '';
30
31 propagatedBuildInputs = [
32 anyio
33 asyncio-throttle
34 ircstates
35 async_stagger
36 async-timeout
37 ] ++ lib.optionals (pythonOlder "3.7") [
38 dataclasses
39 ];
40
41 checkPhase = ''
42 ${python.interpreter} -m unittest test
43 '';
44
45 pythonImportsCheck = [ "ircrobots" ];
46
47 meta = with lib; {
48 description = "Asynchronous bare-bones IRC bot framework for python3";
49 license = licenses.mit;
50 homepage = "https://github.com/jesopo/ircrobots";
51 maintainers = with maintainers; [ hexa ];
52 };
53}