1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 setuptools,
6 # dependencies
7 eth-typing,
8 eth-utils,
9 # nativeCheckInputs
10 asn1tools,
11 factory-boy,
12 hypothesis,
13 pyasn1,
14 pytestCheckHook,
15 coincurve,
16 eth-hash,
17 isPyPy,
18}:
19
20buildPythonPackage rec {
21 pname = "eth-keys";
22 version = "0.6.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "ethereum";
27 repo = "eth-keys";
28 tag = "v${version}";
29 hash = "sha256-HyOfuzwldtqjjowW7HGdZ8RNMXNK3y2NrXUoeMlWJjs=";
30 };
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 eth-typing
36 eth-utils
37 ];
38
39 nativeCheckInputs =
40 [
41 asn1tools
42 factory-boy
43 hypothesis
44 pyasn1
45 pytestCheckHook
46 ]
47 ++ optional-dependencies.coincurve
48 ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3
49 ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome;
50
51 pythonImportsCheck = [ "eth_keys" ];
52
53 optional-dependencies = {
54 coincurve = [ coincurve ];
55 };
56
57 meta = {
58 description = "Common API for Ethereum key operations";
59 homepage = "https://github.com/ethereum/eth-keys";
60 changelog = "https://github.com/ethereum/eth-keys/blob/v${version}/CHANGELOG.rst";
61 license = lib.licenses.mit;
62 maintainers = with lib.maintainers; [ hellwolf ];
63 };
64}