1{ lib, fetchPypi, buildPythonPackage, pythonOlder, pytest, pysha3, pycrypto,
2 pycryptodome }:
3
4buildPythonPackage rec {
5 pname = "eth-hash";
6 version = "0.2.0";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "0xpiz0wrxxj11ki9yapvsibl25qnki90bl3d39nqascg14nw17a9";
11 };
12
13 checkInputs = [ pytest ];
14
15 propagatedBuildInputs = [ pysha3 pycrypto pycryptodome ];
16
17 # setuptools-markdown uses pypandoc which is broken at the moment
18 preConfigure = ''
19 substituteInPlace setup.py --replace \'setuptools-markdown\' ""
20 '';
21
22 # Run tests separately because we don't want to run tests on tests/backends/
23 # but only on its selected subdirectories. Also, the directories under
24 # tests/backends/ must be run separately because they have identically named
25 # test files so pytest would raise errors because of that.
26 #
27 # Also, tests in tests/core/test_import.py are broken so just ignore them:
28 # https://github.com/ethereum/eth-hash/issues/25
29 # There is a pull request to fix the tests:
30 # https://github.com/ethereum/eth-hash/pull/26
31 checkPhase = ''
32 pytest tests/backends/pycryptodome/
33 pytest tests/backends/pysha3/
34 # pytest tests/core/
35 '';
36
37 disabled = pythonOlder "3.5";
38
39 meta = {
40 description = "The Ethereum hashing function keccak256";
41 homepage = "https://github.com/ethereum/eth-hash";
42 license = lib.licenses.mit;
43 maintainers = with lib.maintainers; [ jluttine ];
44 };
45}