15 buildPythonPackage rec {
18 format = "setuptools";
20 disabled = pythonOlder "3.7";
23 inherit pname version;
24 hash = "sha256-4+cGXL2r5hg6uCGZ16T2s7oKQ4xaUSpoVZhGzLdqeOw=";
27 # force kqueue on x86_64-darwin, because our api version does
28 # not support fsevents
29 patches = lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [
33 buildInputs = lib.optionals stdenv.isDarwin [
37 passthru.optional-dependencies.watchmedo = [
46 ] ++ passthru.optional-dependencies.watchmedo;
49 substituteInPlace setup.cfg \
50 --replace "--cov=watchdog" "" \
51 --replace "--cov-report=term-missing" ""
55 "--deselect=tests/test_emitter.py::test_create_wrong_encoding"
56 "--deselect=tests/test_emitter.py::test_close"
57 ] ++ lib.optionals (stdenv.isDarwin) [
58 # fails to stop process in teardown
59 "--deselect=tests/test_0_watchmedo.py::test_auto_restart_subprocess_termination"
60 # assert cap.out.splitlines(keepends=False).count('+++++ 0') == 2 != 3
61 "--deselect=tests/test_0_watchmedo.py::test_auto_restart_on_file_change_debounce"
62 ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
63 # FileCreationEvent != FileDeletionEvent
64 "--deselect=tests/test_emitter.py::test_separate_consecutive_moves"
65 "--deselect=tests/test_observers_polling.py::test___init__"
67 "--deselect=tests/test_delayed_queue.py::test_delayed_get"
68 "--deselect=tests/test_emitter.py::test_delete"
69 # AttributeError: '_thread.RLock' object has no attribute 'key'"
70 "--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching"
71 ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
73 "--deselect=tests/test_delayed_queue.py::test_delayed_get"
74 "--deselect=tests/test_0_watchmedo.py::test_tricks_from_file"
75 "--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_1"
76 "--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_2"
77 "--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching"
78 "--deselect=tests/test_fsevents.py::test_recursive_check_accepts_relative_paths"
79 # fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter
80 "--deselect=tests/test_fsevents.py::test_watchdog_recursive"
81 # SystemError: Cannot start fsevents stream. Use a kqueue or polling observer...
82 "--deselect=tests/test_fsevents.py::test_add_watch_twice"
83 # fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter
84 "--deselect=ests/test_fsevents.py::test_recursive_check_accepts_relative_paths"
86 "--deselect=tests/test_fsevents.py::test_converting_cfstring_to_pyunicode"
90 # tests timeout easily
91 "tests/test_inotify_buffer.py"
92 ] ++ lib.optionals (stdenv.isDarwin) [
93 # segfaults the testsuite
94 "tests/test_emitter.py"
95 # unsupported on x86_64-darwin
96 "tests/test_fsevents.py"
99 pythonImportsCheck = [
104 description = "Python API and shell utilities to monitor file system events";
105 mainProgram = "watchmedo";
106 homepage = "https://github.com/gorakhargosh/watchdog";
107 changelog = "https://github.com/gorakhargosh/watchdog/blob/v${version}/changelog.rst";
108 license = licenses.asl20;
109 maintainers = with maintainers; [ goibhniu ];