depot/third_party/nixpkgs/pkgs/development/python-modules/pyheck/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

56 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
cargo,
fetchFromGitHub,
libiconv,
poetry-core,
pytestCheckHook,
pythonOlder,
rustc,
rustPlatform,
stdenv,
}:
buildPythonPackage rec {
pname = "pyheck";
version = "0.1.5";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "kevinheavey";
repo = "pyheck";
rev = "refs/tags/${version}";
hash = "sha256-mfXkrCbBaJ0da+taKJvfyU5NS43tYJWqtTUXiCLVoGQ=";
};
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [
cargo
poetry-core
rustc
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "pyheck" ];
meta = with lib; {
description = "Python bindings for heck, the Rust case conversion library";
homepage = "https://github.com/kevinheavey/pyheck";
changelog = "https://github.com/kevinheavey/pyheck/blob/${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}