1{ lib
2, buildPythonPackage
3, dnspython
4, fetchPypi
5, geoip2
6, ipython
7, isPyPy
8, praw
9, pyenchant
10, pygeoip
11, pytestCheckHook
12, pythonOlder
13, pytz
14, sqlalchemy
15, xmltodict
16}:
17
18buildPythonPackage rec {
19 pname = "sopel";
20 version = "7.1.9";
21 format = "setuptools";
22
23 disabled = isPyPy || pythonOlder "3.7";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-IJ+ovLQv6/UU1oepmUQjzaWBG3Rdd3xvui7FjK85Urs=";
28 };
29
30 propagatedBuildInputs = [
31 dnspython
32 geoip2
33 ipython
34 praw
35 pyenchant
36 pygeoip
37 pytz
38 sqlalchemy
39 xmltodict
40 ];
41
42 checkInputs = [
43 pytestCheckHook
44 ];
45
46 postPatch = ''
47 substituteInPlace requirements.txt \
48 --replace "praw>=4.0.0,<6.0.0" "praw" \
49 --replace "sqlalchemy<1.4" "sqlalchemy" \
50 --replace "xmltodict==0.12" "xmltodict>=0.12"
51 '';
52
53 preCheck = ''
54 export TESTDIR=$(mktemp -d)
55 cp -R ./test $TESTDIR
56 pushd $TESTDIR
57 '';
58
59 postCheck = ''
60 popd
61 '';
62
63 pythonImportsCheck = [
64 "sopel"
65 ];
66
67 meta = with lib; {
68 description = "Simple and extensible IRC bot";
69 homepage = "https://sopel.chat";
70 license = licenses.efl20;
71 maintainers = with maintainers; [ mog ];
72 };
73}