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