summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/fastuuid/default.nix
blob: 8c4cbe6d623f1f2241c2924543b4879fa8cd3264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
  buildPythonPackage,
  fetchFromGitHub,
  hypothesis,
  lib,
  pytestCheckHook,
  rustPlatform,
}:

buildPythonPackage rec {
  pname = "fastuuid";
  version = "0.14.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "fastuuid";
    repo = "fastuuid";
    tag = version;
    hash = "sha256-EXyd94NR4P+FLPxDCa3LmwfpIHwGduoaPL0qULqcj00=";
  };

  cargoDeps = rustPlatform.importCargoLock {
    lockFile = ./Cargo.lock;
  };

  postPatch = ''
    ln -s ${./Cargo.lock} Cargo.lock
  '';

  nativeBuildInputs = [
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
  ];

  pythonImportsCheck = [ "fastuuid" ];

  nativeCheckInputs = [
    hypothesis
    pytestCheckHook
  ];

  disabledTestPaths = [
    "tests/test_benchmarks.py"
  ];

  meta = {
    changelog = "https://github.com/fastuuid/fastuuid/releases/tag/${src.tag}";
    description = "CPython bindings to Rust's UUID library";
    homepage = "https://github.com/fastuuid/fastuuid";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.dotlambda ];
  };
}