2022-10-30 15:09:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-06-16 17:23:12 +00:00
|
|
|
, anyio
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, setuptools-rust
|
|
|
|
, pythonOlder
|
|
|
|
, dirty-equals
|
|
|
|
, pytest-mock
|
|
|
|
, pytest-timeout
|
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "watchfiles";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.18.1";
|
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}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-XEhu6M1hFi3/gAKZcei7KJSrIhhlZhlvZvbfyA6VLR4=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-IWONA3o+2emJ7cKEw5xYSMdWzGuUSwn1B70zUDzj7Cw=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
2022-08-12 12:06:08 +00:00
|
|
|
maturinBuildHook
|
2022-06-16 17:23:12 +00:00
|
|
|
rust.cargo
|
|
|
|
rust.rustc
|
|
|
|
]);
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
anyio
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
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 ];
|
2022-10-30 15:09:59 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|