depot/third_party/nixpkgs/pkgs/development/python-modules/watchfiles/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

80 lines
1.4 KiB
Nix

{ lib
, stdenv
, anyio
, buildPythonPackage
, fetchFromGitHub
, rustPlatform
, setuptools-rust
, pythonOlder
, dirty-equals
, pytest-mock
, pytest-timeout
, pytestCheckHook
, python
, CoreServices
, libiconv
}:
buildPythonPackage rec {
pname = "watchfiles";
version = "0.18.1";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "samuelcolvin";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-XEhu6M1hFi3/gAKZcei7KJSrIhhlZhlvZvbfyA6VLR4=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-IWONA3o+2emJ7cKEw5xYSMdWzGuUSwn1B70zUDzj7Cw=";
};
buildInputs = lib.optionals stdenv.isDarwin [
CoreServices
libiconv
];
nativeBuildInputs = [
] ++ (with rustPlatform; [
cargoSetupHook
maturinBuildHook
rust.cargo
rust.rustc
]);
propagatedBuildInputs = [
anyio
];
nativeCheckInputs = [
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 ];
};
}