python310Packages.watchdog: Update deps & tests

Trim unused dependency, expose optional dependency.

Update and reorganize disabled tests for all platforms.
This commit is contained in:
Martin Weinelt
2023-03-05 17:46:48 +00:00
parent 1837ae56a6
commit bd162001d7
@@ -2,10 +2,10 @@
, stdenv
, buildPythonPackage
, CoreServices
, eventlet
, fetchpatch
, fetchPypi
, flaky
, pathtools
, pytest-timeout
, pytestCheckHook
, pythonOlder
@@ -32,16 +32,16 @@ buildPythonPackage rec {
CoreServices
];
propagatedBuildInputs = [
pathtools
passthru.optional-dependencies.watchmedo = [
pyyaml
];
nativeCheckInputs = [
eventlet
flaky
pytest-timeout
pytestCheckHook
];
] ++ passthru.optional-dependencies.watchmedo;
postPatch = ''
substituteInPlace setup.cfg \
@@ -49,20 +49,45 @@ buildPythonPackage rec {
--replace "--cov-report=term-missing" ""
'';
disabledTests = [
# probably failing because of an encoding related issue
"test_create_wrong_encoding"
] ++ lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [
"test_delete"
"test_separate_consecutive_moves"
pytestFlagsArray = [
] ++ lib.optionals (stdenv.isAarch64) [
# fails on aarch64-linux on hydra
"test_close"
"--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"
# segfaults
"--deselect=tests/test_delayed_queue.py::test_delayed_get"
"--deselect=tests/test_emitter.py::test_delete"
] ++ 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"
];
disabledTestPaths = [
# Tests are flaky
# tests timeout easily
"tests/test_inotify_buffer.py"
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
# segfaults the testsuite
"tests/test_emitter.py"
"tests/test_fsevents.py"
];
pythonImportsCheck = [