92b3d6365d
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
74 lines
1.3 KiB
Nix
74 lines
1.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, anyio
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, rustPlatform
|
|
, setuptools-rust
|
|
, pythonOlder
|
|
, dirty-equals
|
|
, pytest-mock
|
|
, pytest-timeout
|
|
, pytestCheckHook
|
|
, python
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "watchfiles";
|
|
version = "0.18.0";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "samuelcolvin";
|
|
repo = pname;
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-biGGn0YAUbSO1hCJ4kU0ZWlqlXl/HRrBS3iIA3myRI8=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-nmkIKA4EDMOeppOxKwLSh3oREInlDIcFzE7/EYZRGKY=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
] ++ (with rustPlatform; [
|
|
cargoSetupHook
|
|
maturinBuildHook
|
|
rust.cargo
|
|
rust.rustc
|
|
]);
|
|
|
|
propagatedBuildInputs = [
|
|
anyio
|
|
];
|
|
|
|
checkInputs = [
|
|
dirty-equals
|
|
pytest-mock
|
|
pytest-timeout
|
|
pytestCheckHook
|
|
];
|
|
|
|
postPatch = ''
|
|
sed -i "/^requires-python =.*/a version = '${version}'" pyproject.toml
|
|
'';
|
|
|
|
preCheck = ''
|
|
rm -rf watchfiles
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
"watchfiles"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "File watching and code reload";
|
|
homepage = "https://watchfiles.helpmanual.io/";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ fab ];
|
|
broken = stdenv.isDarwin;
|
|
};
|
|
}
|