1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 # dependencies
7 eth-hash,
8 eth-utils,
9 hexbytes,
10 rlp,
11 sortedcontainers,
12 # nativeCheckInputs
13 hypothesis,
14 pytestCheckHook,
15 pytest-xdist,
16 pydantic,
17}:
18
19buildPythonPackage rec {
20 pname = "trie";
21 version = "3.1.0";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "ethereum";
26 repo = "py-trie";
27 tag = "v${version}";
28 hash = "sha256-QDywlAyFbQGgkATVifdixlnob4Tmsvr/VZ1rafzWKrU=";
29 };
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 eth-hash
35 eth-utils
36 hexbytes
37 rlp
38 sortedcontainers
39 ];
40
41 nativeCheckInputs = [
42 hypothesis
43 pytestCheckHook
44 pytest-xdist
45 pydantic
46 ]
47 ++ eth-hash.optional-dependencies.pycryptodome;
48
49 disabledTests = [
50 # some core tests require fixture submodule and execution spec
51 "test_fixtures_exist"
52 "test_bin_trie_update_value"
53 "test_branch_updates"
54 "test_install_local_wheel"
55 ];
56 disabledTestPaths = [ "tests/core/test_iter.py" ];
57
58 pythonImportsCheck = [ "trie" ];
59
60 meta = {
61 description = "Python library which implements the Ethereum Trie structure";
62 homepage = "https://github.com/ethereum/py-trie";
63 changelog = "https://github.com/ethereum/py-trie/blob/v${version}/CHANGELOG.rst";
64 license = lib.licenses.mit;
65 maintainers = with lib.maintainers; [ hellwolf ];
66 };
67}