summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorJaakko Luttinen <jaakko.luttinen@iki.fi>2018-08-26 14:09:30 +0300
committerJaakko Luttinen <jaakko.luttinen@iki.fi>2018-09-11 17:49:48 +0300
commitc44504410ba5a3bd76a99e7907533779c2b17694 (patch)
treee261174e60bb59d89ebb2dfa7a7a485ea5cfbb87 /pkgs/development
parentcb7c04f53cff64ebb71a27d3e558358aada87041 (diff)
downloadnixlib-c44504410ba5a3bd76a99e7907533779c2b17694.tar
nixlib-c44504410ba5a3bd76a99e7907533779c2b17694.tar.gz
nixlib-c44504410ba5a3bd76a99e7907533779c2b17694.tar.bz2
nixlib-c44504410ba5a3bd76a99e7907533779c2b17694.tar.lz
nixlib-c44504410ba5a3bd76a99e7907533779c2b17694.tar.xz
nixlib-c44504410ba5a3bd76a99e7907533779c2b17694.tar.zst
nixlib-c44504410ba5a3bd76a99e7907533779c2b17694.zip
pythonPackages.eth-hash: init at 0.1.14
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/eth-hash/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/eth-hash/default.nix b/pkgs/development/python-modules/eth-hash/default.nix
new file mode 100644
index 000000000000..ce5fce1b1cba
--- /dev/null
+++ b/pkgs/development/python-modules/eth-hash/default.nix
@@ -0,0 +1,45 @@
+{ lib, fetchPypi, buildPythonPackage, pythonOlder, pytest, pysha3, pycrypto,
+  pycryptodome }:
+
+buildPythonPackage rec {
+  pname = "eth-hash";
+  version = "0.2.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0xpiz0wrxxj11ki9yapvsibl25qnki90bl3d39nqascg14nw17a9";
+  };
+
+  checkInputs = [ pytest ];
+
+  propagatedBuildInputs = [ pysha3 pycrypto pycryptodome ];
+
+  # setuptools-markdown uses pypandoc which is broken at the moment
+  preConfigure = ''
+    substituteInPlace setup.py --replace \'setuptools-markdown\' ""
+  '';
+
+  # Run tests separately because we don't want to run tests on tests/backends/
+  # but only on its selected subdirectories. Also, the directories under
+  # tests/backends/ must be run separately because they have identically named
+  # test files so pytest would raise errors because of that.
+  #
+  # Also, tests in tests/core/test_import.py are broken so just ignore them:
+  # https://github.com/ethereum/eth-hash/issues/25
+  # There is a pull request to fix the tests:
+  # https://github.com/ethereum/eth-hash/pull/26
+  checkPhase = ''
+    pytest tests/backends/pycryptodome/
+    pytest tests/backends/pysha3/
+    # pytest tests/core/
+  '';
+
+  disabled = pythonOlder "3.5";
+
+  meta = {
+    description = "The Ethereum hashing function keccak256";
+    homepage = https://github.com/ethereum/eth-hash;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ jluttine ];
+  };
+}