summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/sopel/default.nix
blob: 3b0165fed65ab0606eadf5ec5e5040f4c71ef4e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  lib,
  buildPythonPackage,
  dnspython,
  fetchPypi,
  geoip2,
  ipython,
  isPyPy,
  setuptools,
  praw,
  pyenchant,
  pytestCheckHook,
  pytz,
  sqlalchemy,
  xmltodict,
  importlib-metadata,
  packaging,
}:

buildPythonPackage rec {
  pname = "sopel";
  version = "8.0.4";
  pyproject = true;

  disabled = isPyPy;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-16QDzsZCquAPH3FPyBjxeXGcvSdjYLZFTXN0ASneROU=";
  };

  build-system = [ setuptools ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "setuptools~=66.1" "setuptools"
  '';

  dependencies = [
    dnspython
    geoip2
    ipython
    praw
    pyenchant
    pytz
    sqlalchemy
    xmltodict
    importlib-metadata
    packaging
  ];

  pythonRemoveDeps = [ "sopel-help" ];

  pythonRelaxDeps = [
    "sqlalchemy"
    "xmltodict"
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [
    # requires network access
    "test_example_exchange_cmd_0"
    "test_example_exchange_cmd_1"
    "test_example_duck_0"
    "test_example_duck_1"
    "test_example_suggest_0"
    "test_example_suggest_1"
    "test_example_suggest_2"
    "test_example_tr2_0"
    "test_example_tr2_1"
    "test_example_tr2_2"
    "test_example_title_command_0"
    "test_example_wiktionary_0"
    "test_example_wiktionary_ety_0"
  ];

  pythonImportsCheck = [ "sopel" ];

  meta = {
    description = "Simple and extensible IRC bot";
    homepage = "https://sopel.chat";
    license = lib.licenses.efl20;
    maintainers = with lib.maintainers; [ mog ];
    mainProgram = "sopel";
  };
}