nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pathtools
6, pyyaml
7, flaky
8, pytest-timeout
9, pytestCheckHook
10, CoreServices
11}:
12
13buildPythonPackage rec {
14 pname = "watchdog";
15 version = "2.1.8";
16 format = "setuptools";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "sha256-bQMUkSaGSr0ycV1OkmfSdUzt4lppBSkBOZNWrTvF7P8=";
21 };
22
23 buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
24
25 propagatedBuildInputs = [
26 pathtools
27 pyyaml
28 ];
29
30 checkInputs = [
31 flaky
32 pytest-timeout
33 pytestCheckHook
34 ];
35
36 postPatch = ''
37 substituteInPlace setup.cfg \
38 --replace "--cov=watchdog" "" \
39 --replace "--cov-report=term-missing" ""
40 '';
41
42 disabledTests = [
43 # probably failing because of an encoding related issue
44 "test_create_wrong_encoding"
45 ];
46
47 disabledTestPaths = [
48 # Tests are flaky
49 "tests/test_inotify_buffer.py"
50 ];
51
52 pythonImportsCheck = [
53 "watchdog"
54 ];
55
56 meta = with lib; {
57 description = "Python API and shell utilities to monitor file system events";
58 homepage = "https://github.com/gorakhargosh/watchdog";
59 license = licenses.asl20;
60 maintainers = with maintainers; [ goibhniu ];
61 # error: use of undeclared identifier 'kFSEventStreamEventFlagItemCloned'
62 # builds fine on aarch64-darwin
63 broken = stdenv.isDarwin && !stdenv.isAarch64;
64 };
65}