summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/cyscale/default.nix
blob: 61b0c62a7d45ce9f6cab8c569ad5453e2adca38c (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  more-itertools,
  base58,
  pytestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "cyscale";
  version = "0.4.0";
  pyproject = true;

  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "latent-to";
    repo = "cyscale";
    tag = "v${finalAttrs.version}";
    hash = "sha256-QkIyb00/KIVicdX/k3UhjGSvcwQ+yxcSAkMlC7tVpLM=";
  };

  build-system = [ setuptools ];

  dependencies = [
    more-itertools
    base58
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  # test_valid_type_registry_presets walks ../scalecodec/type_registry relative
  # to the test file, which no longer exists after removing the source package dir
  disabledTests = [ "test_valid_type_registry_presets" ];

  # remove source package so tests import the installed Cython extensions, not the .pyx sources
  preCheck = ''
    rm -rf scalecodec
  '';

  pythonImportsCheck = [ "scalecodec" ];

  meta = {
    description = "Cython-accelerated SCALE codec library for Substrate-based blockchains (Polkadot, Kusama, Bittensor, etc.)";
    longDescription = "A drop-in replacement for py-scale-codec — same scalecodec module name, same public API, compiled with Cython for improved throughput.";
    homepage = "https://github.com/latent-to/cyscale";
    changelog = "https://github.com/latent-to/cyscale/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ kilyanni ];
  };
})