about summary refs log tree commit diff
path: root/pkgs/applications/blockchains/chia-dev-tools/default.nix
blob: 287a711d23489b4e276af08b3a9914e6505dc522 (plain) (blame)
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
54
55
56
57
58
59
60
61
62
63
64
65
{ lib
, fetchFromGitHub
, substituteAll
, python3Packages
, chia
,
}:
python3Packages.buildPythonApplication rec {
  pname = "chia-dev-tools";
  version = "1.1.5";

  src = fetchFromGitHub {
    owner = "Chia-Network";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-qWWLQ+SkoRu5cLytwwrslqsKORy+4ebO8brULEFGaF0=";
  };

  patches = [
    (substituteAll {
      src = ./fix-paths.patch;
      inherit chia;
    })
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "==" ">="
  '';

  nativeBuildInputs = [
    python3Packages.setuptools-scm
  ];

  # give a hint to setuptools-scm on package version
  SETUPTOOLS_SCM_PRETEND_VERSION = "v${version}";

  propagatedBuildInputs = with python3Packages; [
    anyio
    (toPythonModule chia)
    pytest # required at runtime by the "test" command
    pytest-asyncio
    pytimeparse
  ];

  nativeCheckInputs = with python3Packages; [
    pytestCheckHook
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';
  postCheck = "unset HOME";

  disabledTests = [
    "test_spendbundles"
  ];

  meta = with lib; {
    homepage = "https://www.chia.net/";
    description = "Utility for developing in the Chia ecosystem: Chialisp functions, object inspection, RPC client and more";
    license = with licenses; [ asl20 ];
    maintainers = teams.chia.members;
  };
}