2021-03-12 07:09:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2023-01-20 10:41:00 +00:00
|
|
|
, CoreServices
|
2023-03-15 16:39:30 +00:00
|
|
|
, eventlet
|
2023-01-20 10:41:00 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2021-06-28 23:13:55 +00:00
|
|
|
, flaky
|
2021-06-01 10:57:12 +00:00
|
|
|
, pytest-timeout
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytestCheckHook
|
2023-01-20 10:41:00 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "watchdog";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.0.0";
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-TZijIFldp6fFoY/EjLYzwuc82nj5PKwu9C1Cv2CaM/k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# force kqueue on x86_64-darwin, because our api version does
|
|
|
|
# not support fsevents
|
2022-06-26 10:26:21 +00:00
|
|
|
patches = lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [
|
|
|
|
./force-kqueue.patch
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
CoreServices
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
passthru.optional-dependencies.watchmedo = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
eventlet
|
2021-06-28 23:13:55 +00:00
|
|
|
flaky
|
2021-06-01 10:57:12 +00:00
|
|
|
pytest-timeout
|
2021-02-05 17:12:51 +00:00
|
|
|
pytestCheckHook
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ passthru.optional-dependencies.watchmedo;
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov=watchdog" "" \
|
|
|
|
--replace "--cov-report=term-missing" ""
|
|
|
|
'';
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--deselect=tests/test_emitter.py::test_create_wrong_encoding"
|
|
|
|
"--deselect=tests/test_emitter.py::test_close"
|
|
|
|
] ++ lib.optionals (stdenv.isDarwin) [
|
|
|
|
# fails to stop process in teardown
|
|
|
|
"--deselect=tests/test_0_watchmedo.py::test_auto_restart_subprocess_termination"
|
|
|
|
# assert cap.out.splitlines(keepends=False).count('+++++ 0') == 2 != 3
|
|
|
|
"--deselect=tests/test_0_watchmedo.py::test_auto_restart_on_file_change_debounce"
|
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
|
|
|
|
# FileCreationEvent != FileDeletionEvent
|
|
|
|
"--deselect=tests/test_emitter.py::test_separate_consecutive_moves"
|
2023-05-24 13:37:59 +00:00
|
|
|
"--deselect=tests/test_observers_polling.py::test___init__"
|
2023-03-15 16:39:30 +00:00
|
|
|
# segfaults
|
|
|
|
"--deselect=tests/test_delayed_queue.py::test_delayed_get"
|
|
|
|
"--deselect=tests/test_emitter.py::test_delete"
|
|
|
|
# AttributeError: '_thread.RLock' object has no attribute 'key'"
|
|
|
|
"--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching"
|
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# segfaults
|
|
|
|
"--deselect=tests/test_delayed_queue.py::test_delayed_get"
|
|
|
|
"--deselect=tests/test_0_watchmedo.py::test_tricks_from_file"
|
|
|
|
"--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_1"
|
|
|
|
"--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_2"
|
|
|
|
"--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching"
|
|
|
|
"--deselect=tests/test_fsevents.py::test_recursive_check_accepts_relative_paths"
|
|
|
|
# fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter
|
|
|
|
"--deselect=tests/test_fsevents.py::test_watchdog_recursive"
|
|
|
|
# SystemError: Cannot start fsevents stream. Use a kqueue or polling observer...
|
|
|
|
"--deselect=tests/test_fsevents.py::test_add_watch_twice"
|
|
|
|
# fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter
|
|
|
|
"--deselect=ests/test_fsevents.py::test_recursive_check_accepts_relative_paths"
|
|
|
|
# gets stuck
|
|
|
|
"--deselect=tests/test_fsevents.py::test_converting_cfstring_to_pyunicode"
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
disabledTestPaths = [
|
2023-03-15 16:39:30 +00:00
|
|
|
# tests timeout easily
|
2021-12-26 17:43:05 +00:00
|
|
|
"tests/test_inotify_buffer.py"
|
2023-05-24 13:37:59 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin) [
|
2023-03-15 16:39:30 +00:00
|
|
|
# segfaults the testsuite
|
|
|
|
"tests/test_emitter.py"
|
2023-05-24 13:37:59 +00:00
|
|
|
# unsupported on x86_64-darwin
|
2023-03-15 16:39:30 +00:00
|
|
|
"tests/test_fsevents.py"
|
2021-12-26 17:43:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"watchdog"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python API and shell utilities to monitor file system events";
|
|
|
|
homepage = "https://github.com/gorakhargosh/watchdog";
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/gorakhargosh/watchdog/blob/v${version}/changelog.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ goibhniu ];
|
|
|
|
};
|
|
|
|
}
|