2022-10-30 15:09:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-06-16 17:23:12 +00:00
|
|
|
, anyio
|
|
|
|
, buildPythonPackage
|
2023-05-24 13:37:59 +00:00
|
|
|
, cargo
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2023-05-24 13:37:59 +00:00
|
|
|
, rustc
|
2022-06-16 17:23:12 +00:00
|
|
|
, pythonOlder
|
|
|
|
, dirty-equals
|
|
|
|
, pytest-mock
|
|
|
|
, pytest-timeout
|
|
|
|
, pytestCheckHook
|
2023-02-09 11:40:11 +00:00
|
|
|
, CoreServices
|
|
|
|
, libiconv
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "watchfiles";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "0.21.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}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-/qNgkPF5N8jzSV3M0YFWvQngZ4Hf4WM/GBS1LtgFbWM=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-sqHTW1+E7Fp33KW6IYlNa77AYc2iCfaSoBRXzrhEKr8=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
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
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
anyio
|
|
|
|
];
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"watchfiles"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-10-30 15:09:59 +00:00
|
|
|
description = "File watching and code reload";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://watchfiles.helpmanual.io/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|