Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.rlp: 1.0.1 -> 1.0.2 (with some new deps) #45644

Merged
merged 10 commits into from
Sep 12, 2018
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/backports-shutil-which/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ stdenv, fetchPypi, fetchFromGitHub, buildPythonPackage, pytest }:

buildPythonPackage rec {
pname = "backports.shutil_which";
version = "3.5.1";

src = fetchPypi {
inherit pname version;
sha256 = "16sa3adkf71862cb9pk747pw80a2f1v5m915ijb4fgj309xrlhyx";
};

checkInputs = [ pytest ];

checkPhase = ''
py.test test
'';

meta = with stdenv.lib; {
description = "Backport of shutil.which from Python 3.3";
homepage = https://github.com/minrk/backports.shutil_which;
license = licenses.psfl;
maintainers = with maintainers; [ jluttine ];
};
}
45 changes: 45 additions & 0 deletions pkgs/development/python-modules/eth-hash/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
35 changes: 35 additions & 0 deletions pkgs/development/python-modules/eth-typing/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ lib, fetchFromGitHub, buildPythonPackage, pythonOlder, pytest }:

buildPythonPackage rec {
pname = "eth-typing";
version = "1.3.0";

# Tests are missing from the PyPI source tarball so let's use GitHub
# https://github.com/ethereum/eth-typing/issues/8
src = fetchFromGitHub {
owner = "ethereum";
repo = pname;
rev = "v${version}";
sha256 = "0703z7vlsfa3dvgcq22f9rzmj0svyp2a8wc7h73d0aac28ydhpv9";
};

# setuptools-markdown uses pypandoc which is broken at the moment
preConfigure = ''
substituteInPlace setup.py --replace \'setuptools-markdown\' ""
'';

disabled = pythonOlder "3.5";

checkInputs = [ pytest ];

checkPhase = ''
pytest .
'';

meta = {
description = "Common type annotations for Ethereum Python packages";
homepage = https://github.com/ethereum/eth-typing;
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jluttine ];
};
}
35 changes: 35 additions & 0 deletions pkgs/development/python-modules/eth-utils/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ lib, fetchFromGitHub, buildPythonPackage, pytest, eth-hash, eth-typing,
cytoolz, hypothesis }:

buildPythonPackage rec {
pname = "eth-utils";
version = "1.2.1";

# Tests are missing from the PyPI source tarball so let's use GitHub
# https://github.com/ethereum/eth-utils/issues/130
src = fetchFromGitHub {
owner = "ethereum";
repo = pname;
rev = "v${version}";
sha256 = "0g8f5vdjh7qd8kgsqqd9qkm6m79rx3w9yp0rf9vpdsv3xfzrkh1w";
};

checkInputs = [ pytest hypothesis ];
propagatedBuildInputs = [ eth-hash eth-typing cytoolz ];

# setuptools-markdown uses pypandoc which is broken at the moment
preConfigure = ''
substituteInPlace setup.py --replace \'setuptools-markdown\' ""
'';

checkPhase = ''
pytest .
'';

meta = {
description = "Common utility functions for codebases which interact with ethereum";
homepage = https://github.com/ethereum/eth-utils;
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jluttine ];
};
}
9 changes: 7 additions & 2 deletions pkgs/development/python-modules/ledgerblue/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchPypi, buildPythonPackage, hidapi
, pycrypto, pillow, protobuf, future, ecpy
, pycrypto, pillow, protobuf, future, ecpy, python-u2flib-host, pycryptodomex
}:

buildPythonPackage rec {
Expand All @@ -11,7 +11,12 @@ buildPythonPackage rec {
sha256 = "3969b3c375c0f3fb60ff1645621ebf2f39fb697a53851620705f27ed7b283097";
};

buildInputs = [ hidapi pycrypto pillow protobuf future ecpy ];
propagatedBuildInputs = [
hidapi pycrypto pillow protobuf future ecpy python-u2flib-host pycryptodomex
];

# No tests
doCheck = false;

meta = with stdenv.lib; {
description = "Python library to communicate with Ledger Blue/Nano S";
Expand Down
14 changes: 5 additions & 9 deletions pkgs/development/python-modules/libagent/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchPypi, buildPythonPackage, ed25519, ecdsa
, semver, keepkey, trezor, mnemonic, ledgerblue, unidecode, mock, pytest
}:
{ stdenv, fetchPypi, buildPythonPackage, ed25519, ecdsa , semver, mnemonic,
unidecode, mock, pytest , backports-shutil-which, ConfigArgParse,
pythondaemon, pymsgbox }:

buildPythonPackage rec {
pname = "libagent";
Expand All @@ -11,12 +11,8 @@ buildPythonPackage rec {
sha256 = "55af1ad2a6c95aef1fc5588c2002c9e54edbb14e248776b64d00628235ceda3e";
};

buildInputs = [
ed25519 ecdsa semver keepkey
trezor mnemonic ledgerblue
];

propagatedBuildInputs = [ unidecode ];
propagatedBuildInputs = [ unidecode backports-shutil-which ConfigArgParse
pythondaemon pymsgbox ecdsa ed25519 mnemonic semver ];

checkInputs = [ mock pytest ];

Expand Down
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/pymsgbox/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ stdenv, fetchPypi, buildPythonPackage, tkinter }:

buildPythonPackage rec {
pname = "PyMsgBox";
version = "1.0.6";

src = fetchPypi {
inherit pname version;
sha256 = "0kmd00w7p6maiyqpqqb2j8m6v2gh9c0h5i198pa02bc1c1m1321q";
extension = "zip";
};

propagatedBuildInputs = [ tkinter ];

# Finding tests fails
doCheck = false;

meta = with stdenv.lib; {
description = "A simple, cross-platform, pure Python module for JavaScript-like message boxes";
homepage = https://github.com/asweigart/PyMsgBox;
license = licenses.bsd3;
maintainers = with maintainers; [ jluttine ];
};
}
23 changes: 23 additions & 0 deletions pkgs/development/python-modules/python-u2flib-host/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ stdenv, fetchPypi, buildPythonPackage, requests, hidapi }:

buildPythonPackage rec {
pname = "python-u2flib-host";
version = "3.0.3";

src = fetchPypi {
inherit pname version;
sha256 = "02pwafd5kyjpc310ys0pgnd0adff1laz18naxxwsfrllqafqnrxb";
};

propagatedBuildInputs = [ requests hidapi ];

# Tests fail: "ValueError: underlying buffer has been detached"
doCheck = false;

meta = with stdenv.lib; {
description = "Python based U2F host library";
homepage = https://github.com/Yubico/python-u2flib-host;
license = licenses.bsd2;
maintainers = with maintainers; [ jluttine ];
};
}
16 changes: 13 additions & 3 deletions pkgs/development/python-modules/rlp/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, fetchPypi, buildPythonPackage, pytest }:
{ lib, fetchPypi, buildPythonPackage, pytest, hypothesis, eth-utils }:

buildPythonPackage rec {
pname = "rlp";
Expand All @@ -9,8 +9,18 @@ buildPythonPackage rec {
sha256 = "040fb5172fa23d27953a886c40cac989fc031d0629db934b5a9edcd2fb28df1e";
};

checkInputs = [ pytest ];
propagatedBuildInputs = [ ];
checkInputs = [ pytest hypothesis ];
propagatedBuildInputs = [ eth-utils ];

# setuptools-markdown uses pypandoc which is broken at the moment
preConfigure = ''
substituteInPlace setup.py --replace \'setuptools-markdown\' ""
substituteInPlace setup.py --replace "long_description_markdown_filename='README.md'," ""
'';

checkPhase = ''
pytest .
'';

meta = {
description = "A package for encoding and decoding data in and from Recursive Length Prefix notation";
Expand Down
12 changes: 12 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ in {

backports_csv = callPackage ../development/python-modules/backports_csv {};

backports-shutil-which = callPackage ../development/python-modules/backports-shutil-which {};

bap = callPackage ../development/python-modules/bap {
bap = pkgs.ocamlPackages.bap;
};
Expand Down Expand Up @@ -469,6 +471,8 @@ in {

pymatgen-lammps = callPackage ../development/python-modules/pymatgen-lammps { };

pymsgbox = callPackage ../development/python-modules/pymsgbox { };

pynisher = callPackage ../development/python-modules/pynisher { };

pyparser = callPackage ../development/python-modules/pyparser { };
Expand Down Expand Up @@ -1655,6 +1659,12 @@ in {

envs = callPackage ../development/python-modules/envs { };

eth-hash = callPackage ../development/python-modules/eth-hash { };

eth-typing = callPackage ../development/python-modules/eth-typing { };

eth-utils = callPackage ../development/python-modules/eth-utils { };

jsonrpc-async = callPackage ../development/python-modules/jsonrpc-async { };

jsonrpc-base = callPackage ../development/python-modules/jsonrpc-base { };
Expand Down Expand Up @@ -16238,6 +16248,8 @@ EOF

potr = callPackage ../development/python-modules/potr {};

python-u2flib-host = callPackage ../development/python-modules/python-u2flib-host { };

pluggy = callPackage ../development/python-modules/pluggy {};

xcffib = callPackage ../development/python-modules/xcffib {};
Expand Down