2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
anyio,
|
|
|
|
buildPythonPackage,
|
|
|
|
cargo,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
rustc,
|
|
|
|
pythonOlder,
|
|
|
|
dirty-equals,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-timeout,
|
|
|
|
pytestCheckHook,
|
|
|
|
CoreServices,
|
|
|
|
libiconv,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "watchfiles";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.22.0";
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "pyproject";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samuelcolvin";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-TtRSRgtMOqsnhdvsic3lg33xlA+r/DcYHlzewSOu/44=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-n9yN/VRNQWCxh+BoliIMkKqJC51inpB9DQ9WtqR4oA0=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-02-09 11:40:11 +00:00
|
|
|
CoreServices
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
2023-05-24 13:37:59 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustPlatform.maturinBuildHook
|
|
|
|
cargo
|
|
|
|
rustc
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ anyio ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
# Tests need these permissions in order to use the FSEvents API on macOS.
|
|
|
|
sandboxProfile = ''
|
|
|
|
(allow mach-lookup (global-name "com.apple.FSEvents"))
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
dirty-equals
|
|
|
|
pytest-mock
|
|
|
|
pytest-timeout
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/^requires-python =.*/a version = '${version}'" pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
rm -rf watchfiles
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabledTests = [
|
|
|
|
# BaseExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
|
|
|
|
"test_awatch_interrupt_raise"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "watchfiles" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-10-30 15:09:59 +00:00
|
|
|
description = "File watching and code reload";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "watchfiles";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://watchfiles.helpmanual.io/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|