aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/ircstates/default.nix
blob: 857b0358aff2f7b6e636957306f5f4e4610dc83b (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pythonOlder
, irctokens
, pendulum
, python
}:

buildPythonPackage rec {
  pname = "ircstates";
  version = "0.11.3";
  disabled = pythonOlder "3.6";  # f-strings

  src = fetchFromGitHub {
    owner = "jesopo";
    repo = pname;
    rev = "v${version}";
    sha256 = "1v8r6ma8gzvn5ym3xx9qlb0rc4l67pxr3z8njzk1ffxn1x3mxd3i";
  };

  patches = [
    (fetchpatch {
      name = "relax-pendulum-version.patch";
      url = "https://github.com/jesopo/ircstates/commit/f51f1b689e592020d1c91ccab6c03927aadb9f94.patch";
      sha256 = "0qbp3b9hlqbbx7b474q1mcgnzzzwcm4g89x26iqgmlgxzmv3y5xp";
    })
  ];

  propagatedBuildInputs = [
    irctokens
    pendulum
  ];

  checkPhase = ''
    ${python.interpreter} -m unittest test
  '';

  pythonImportsCheck = [ "ircstates" ];

  meta = with lib; {
    description = "sans-I/O IRC session state parsing library";
    license = licenses.mit;
    homepage = "https://github.com/jesopo/ircstates";
    maintainers = with maintainers; [ hexa ];
  };
}