19 buildPythonPackage rec {
24 disabled = pythonOlder "3.7";
26 src = fetchFromGitHub {
27 owner = "samuelcolvin";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-TtRSRgtMOqsnhdvsic3lg33xlA+r/DcYHlzewSOu/44=";
33 cargoDeps = rustPlatform.fetchCargoTarball {
35 name = "${pname}-${version}";
36 hash = "sha256-n9yN/VRNQWCxh+BoliIMkKqJC51inpB9DQ9WtqR4oA0=";
39 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
45 rustPlatform.cargoSetupHook
46 rustPlatform.maturinBuildHook
51 propagatedBuildInputs = [ anyio ];
53 # Tests need these permissions in order to use the FSEvents API on macOS.
55 (allow mach-lookup (global-name "com.apple.FSEvents"))
66 sed -i "/^requires-python =.*/a version = '${version}'" pyproject.toml
74 # BaseExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
75 "test_awatch_interrupt_raise"
78 pythonImportsCheck = [ "watchfiles" ];
81 description = "File watching and code reload";
82 mainProgram = "watchfiles";
83 homepage = "https://watchfiles.helpmanual.io/";
84 license = licenses.mit;
85 maintainers = with maintainers; [ fab ];