nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 cargo,
5 fetchFromGitHub,
6 libiconv,
7 poetry-core,
8 pytestCheckHook,
9 rustc,
10 rustPlatform,
11 stdenv,
12}:
13
14buildPythonPackage rec {
15 pname = "pyheck";
16 version = "0.1.5";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "kevinheavey";
21 repo = "pyheck";
22 tag = version;
23 hash = "sha256-mfXkrCbBaJ0da+taKJvfyU5NS43tYJWqtTUXiCLVoGQ=";
24 };
25
26 cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
27
28 postPatch = ''
29 ln -s ${./Cargo.lock} Cargo.lock
30 '';
31
32 nativeBuildInputs = [
33 cargo
34 poetry-core
35 rustc
36 rustPlatform.cargoSetupHook
37 rustPlatform.maturinBuildHook
38 ];
39
40 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 pythonImportsCheck = [ "pyheck" ];
45
46 meta = {
47 description = "Python bindings for heck, the Rust case conversion library";
48 homepage = "https://github.com/kevinheavey/pyheck";
49 changelog = "https://github.com/kevinheavey/pyheck/blob/${version}/CHANGELOG.md";
50 license = lib.licenses.mit;
51 maintainers = with lib.maintainers; [ fab ];
52 };
53}