nixpkgs/pkgs/development/python-modules/watchfiles/default.nix
Alyssa Ross 5e06b3cb19 treewide: don't use rustPlatform.rust
This will be deprecated in the next commit.
2023-05-12 15:31:21 +00:00

82 lines
1.4 KiB
Nix

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