nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchPypi,
4 buildPythonPackage,
5 rustPlatform,
6 nix-update-script,
7
8 # build-system
9 maturin,
10
11 # nativeCheckInputs
12 pytestCheckHook,
13 pytest-benchmark,
14 pytest-codspeed,
15 pytest-xdist,
16}:
17
18buildPythonPackage rec {
19 pname = "libipld";
20 version = "3.3.2";
21 pyproject = true;
22
23 # use pypi, GitHub does not include Cargo.lock
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-foXM2RNhEOY5Q9lSMrGTyJPjacQGJz0jUWDlzEs5yc4=";
27 };
28
29 cargoDeps = rustPlatform.fetchCargoVendor {
30 inherit src;
31 hash = "sha256-BtFIX6xCJWBkIOzYEr8XohA1jsXC9rhiaMd87pe101w=";
32 };
33
34 build-system = [
35 maturin
36 ];
37
38 nativeBuildInputs = with rustPlatform; [
39 cargoSetupHook
40 maturinBuildHook
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 pytest-benchmark
46 pytest-codspeed
47 pytest-xdist
48 ];
49
50 pytestFlags = [ "--benchmark-disable" ];
51
52 disabledTests = [
53 # touches network
54 "test_decode_car"
55 ];
56
57 pythonImportsCheck = [ "libipld" ];
58
59 passthru.updateScript = nix-update-script { };
60
61 meta = {
62 description = "Fast Python library to work with IPLD: DAG-CBOR, CID, CAR, multibase";
63 homepage = "https://github.com/MarshalX/python-libipld";
64 changelog = "https://github.com/MarshalX/python-libipld/releases/tag/v${version}";
65 license = lib.licenses.mit;
66 maintainers = with lib.maintainers; [ vji ];
67 };
68}