nbPython3Packages: fix clightning pkgs
Also enable tests for the pyln-* pkgs.
This commit is contained in:
parent
6bdf0ac3fb
commit
f234e59ca5
@ -14,7 +14,10 @@ let
|
||||
|
||||
plugins = with nbPython3Packages; {
|
||||
helpme = { description = "Walks you through setting up a c-lightning node, offering advice for common problems"; };
|
||||
monitor = { description = "Helps you analyze the health of your peers and channels"; };
|
||||
monitor = {
|
||||
description = "Helps you analyze the health of your peers and channels";
|
||||
extraPkgs = [ packaging ];
|
||||
};
|
||||
prometheus = {
|
||||
description = "Lightning node exporter for the prometheus timeseries server";
|
||||
extraPkgs = [ prometheus_client ];
|
||||
|
@ -3,11 +3,11 @@ autoconf, automake, libtool, libffi, requests }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "coincurve";
|
||||
version = "15.0.0";
|
||||
version = "17.0.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0ras7qb4ib9sik703fcb9f3jrgq7nx5wvdgx9k1pshmrxl8lnlh6";
|
||||
hash = "sha256-aNpVr/iYcClS/aPuBP1u1gu2uR+RnGknB4btdmtUi5M";
|
||||
};
|
||||
|
||||
doCheck = false;
|
||||
|
@ -4,6 +4,8 @@ let
|
||||
|
||||
joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; };
|
||||
clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; };
|
||||
|
||||
unstable = (import ../nixpkgs-pinned.nix).nixpkgs-unstable;
|
||||
in {
|
||||
bencoderpyx = callPackage ./bencoderpyx {};
|
||||
coincurve = callPackage ./coincurve {};
|
||||
@ -26,15 +28,17 @@ in {
|
||||
|
||||
## Specific versions of packages that already exist in nixpkgs
|
||||
|
||||
# base58 2.1.0, required by pyln-proto
|
||||
base58 = callPackage ./specific-versions/base58.nix {};
|
||||
|
||||
# cryptography 3.3.2, required by joinmarketdaemon
|
||||
# Used in the private python package set for joinmarket (../joinmarket/default.nix)
|
||||
cryptography_3_3_2 = callPackage ./specific-versions/cryptography {
|
||||
cryptography_vectors = callPackage ./specific-versions/cryptography/vectors.nix {};
|
||||
};
|
||||
|
||||
# cryptography 36.0.0, required by pyln-proto.
|
||||
cryptography = callPackage "${unstable}/pkgs/development/python-modules/cryptography" {
|
||||
Security = self.darwin.apple_sdk.frameworks.Security;
|
||||
};
|
||||
|
||||
# autobahn 20.12.3, required by joinmarketclient
|
||||
autobahn = callPackage ./specific-versions/autobahn.nix {};
|
||||
|
||||
|
@ -1,22 +1,17 @@
|
||||
{ buildPythonPackage, clightning, pyln-proto }:
|
||||
{ buildPythonPackage, poetry-core, pytestCheckHook, clightning, pyln-proto }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyln-bolt7";
|
||||
|
||||
# See fn `bolt_meta` in
|
||||
# https://github.com/ElementsProject/lightning/blob/master/contrib/pyln-spec/bolt7/setup.py
|
||||
version = "1.0.2.186";
|
||||
# The version is defined here:
|
||||
# https://github.com/ElementsProject/lightning/blob/master/contrib/pyln-spec/bolt7/pyproject.toml
|
||||
version = "1.0.2.186.post0";
|
||||
format = "pyproject";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
nativeBuildInputs = [ poetry-core ];
|
||||
propagatedBuildInputs = [ pyln-proto ];
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-spec/bolt7";
|
||||
|
||||
# TODO-EXTERNAL:
|
||||
# Remove when this fix is released
|
||||
# https://github.com/ElementsProject/lightning/pull/4910
|
||||
postPatch = ''
|
||||
sed -i 's|pyln.proto|pyln-proto|' requirements.txt
|
||||
'';
|
||||
}
|
||||
|
@ -1,14 +1,27 @@
|
||||
{ buildPythonPackage, clightning, pyln-bolt7, recommonmark, setuptools-scm }:
|
||||
{ buildPythonPackage, poetry-core, pytestCheckHook, clightning, pyln-bolt7, pyln-proto }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyln-client";
|
||||
version = clightning.version;
|
||||
format = "pyproject";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
propagatedBuildInputs = [ pyln-bolt7 recommonmark setuptools-scm ];
|
||||
nativeBuildInputs = [ poetry-core ];
|
||||
|
||||
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
||||
propagatedBuildInputs = [
|
||||
pyln-bolt7
|
||||
pyln-proto
|
||||
];
|
||||
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}";
|
||||
|
||||
# Fix version typo in pyproject.toml
|
||||
# TODO-EXTERNAL:
|
||||
# This is already fixed upstream. Remove this after the next clightning release.
|
||||
postPatch = ''
|
||||
sed -i 's|pyln-bolt7 = "^1.0.186"|pyln-bolt7 = "^1.0.2.186"|' pyproject.toml
|
||||
'';
|
||||
}
|
||||
|
@ -1,38 +1,30 @@
|
||||
{ buildPythonPackage, clightning
|
||||
{ buildPythonPackage
|
||||
, clightning
|
||||
, poetry-core
|
||||
, pytestCheckHook
|
||||
, bitstring
|
||||
, cryptography
|
||||
, coincurve
|
||||
, base58
|
||||
, mypy
|
||||
, pycparser
|
||||
, setuptools-scm
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyln-proto";
|
||||
version = clightning.version;
|
||||
format = "pyproject";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
nativeBuildInputs = [ poetry-core ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
bitstring
|
||||
cryptography
|
||||
coincurve
|
||||
pycparser
|
||||
base58
|
||||
mypy
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-proto";
|
||||
postPatch = ''
|
||||
sed -i '
|
||||
s|pycparser==2.20|pycparser~=2.20|
|
||||
s|coincurve ~= 13.0|coincurve == 15.0.0|
|
||||
s|base58 ~= 2.0.1|base58 == 2.1.0|
|
||||
s|mypy==0.790|mypy == 0.812|
|
||||
' requirements.txt
|
||||
'';
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pyhamcrest
|
||||
, pytest-benchmark
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "base58";
|
||||
version = "2.1.0";
|
||||
disabled = pythonOlder "3.5";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-FxpUe0o8YeGuOAciSm967HXjZMQ5XnViZJ1zNXaAAaI=";
|
||||
};
|
||||
|
||||
checkInputs = [
|
||||
pyhamcrest
|
||||
pytest-benchmark
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "base58" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Base58 and Base58Check implementation";
|
||||
homepage = "https://github.com/keis/base58";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ nyanloutre ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user