about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/cepa/default.nix
blob: 5e28aca3c6424b990556d8b3d2a9d02d6b34ab3b (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, python
, mock
}:

buildPythonPackage rec {
  pname = "cepa";
  version = "1.8.4";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-P7xwGsP8ic1/abxYptDXNbAU+kC2Hiwu/Tge0g21ipY=";
  };

  patches = [
    (fetchpatch {
      name = "python-3.11-compatibility.patch";
      url = "https://github.com/onionshare/cepa/commit/0bf9aee7151e65594c532826bb04636e1d80fb6f.patch";
      hash = "sha256-roSt9N5OvnOOxKZUee86zGXt0AsZCcbBdV2cLz1MB2k=";
    })
  ];

  postPatch = ''
    rm test/unit/installation.py
    sed -i "/test.unit.installation/d" test/settings.cfg
    # https://github.com/torproject/stem/issues/56
    sed -i '/MOCK_VERSION/d' run_tests.py
  '';

  nativeCheckInputs = [ mock ];

  checkPhase = ''
    touch .gitignore
    ${python.interpreter} run_tests.py -u
  '';

  meta = with lib; {
    description = "Controller library that allows applications to interact with Tor";
    homepage = "https://github.com/onionshare/cepa";
    license = licenses.lgpl3Only;
    maintainers = with maintainers; [ bbjubjub ];
  };
}