about summary refs log tree commit diff
path: root/pkgs/development/python-modules/watchdog-gevent/default.nix
blob: fb5951a38ce4d692dfd23d3a3ef99a55e7685940 (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
48
49
50
51
52
53
54
55
56
57
58
59
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  gevent,
  pytestCheckHook,
  setuptools,
  pythonOlder,
  watchdog,
}:

buildPythonPackage rec {
  pname = "watchdog-gevent";
  version = "0.1.1";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "Bogdanp";
    repo = "watchdog_gevent";
    rev = "refs/tags/v${version}";
    hash = "sha256-FESm3fNuLmOg2ilI/x8U9LuAimHLnahcTHYzW/nzOVY=";
  };

  patches = [
    # Add new event_filter argument to GeventEmitter
    (fetchpatch {
      name = "new-event_filter-argument.patch";
      url = "https://github.com/Bogdanp/watchdog_gevent/commit/a98b6599aefb6f1ea6f9682485ed460c52f6e55f.patch";
      hash = "sha256-lbUtl8IbnJjlsIpbC+wXLvYB+ZtUuHWqFtf31Bfqc2I=";
    })
  ];

  postPatch = ''
    sed -i setup.cfg \
      -e 's:--cov watchdog_gevent::' \
      -e 's:--cov-report html::'
  '';

  build-system = [ setuptools ];

  dependencies = [
    gevent
    watchdog
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "watchdog_gevent" ];

  meta = with lib; {
    description = "A gevent-based observer for watchdog";
    homepage = "https://github.com/Bogdanp/watchdog_gevent";
    license = licenses.asl20;
    maintainers = with maintainers; [ traxys ];
  };
}