From 04b6a09be4f1974bd8eb05bb118be8b2c0d05eff Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 9 May 2025 13:31:18 +0200 Subject: [PATCH] clightning-plugins: use `clnrest`, remove Python version --- modules/clightning-plugins/clnrest.nix | 4 +- pkgs/python-packages/clnrest/default.nix | 59 ------------------------ pkgs/python-packages/default.nix | 3 +- 3 files changed, 4 insertions(+), 62 deletions(-) delete mode 100644 pkgs/python-packages/clnrest/default.nix diff --git a/modules/clightning-plugins/clnrest.nix b/modules/clightning-plugins/clnrest.nix index a5a39ee..d073700 100644 --- a/modules/clightning-plugins/clnrest.nix +++ b/modules/clightning-plugins/clnrest.nix @@ -37,8 +37,8 @@ let }; package = mkOption { type = types.package; - default = config.nix-bitcoin.pkgs.nbPython3Packages.clnrest; - defaultText = "config.nix-bitcoin.pkgs.nbPython3Packages.clnrest"; + default = config.nix-bitcoin.pkgs.clnrest; + defaultText = "config.nix-bitcoin.pkgs.clnrest"; description = "The package providing clnrest binaries."; }; }; diff --git a/pkgs/python-packages/clnrest/default.nix b/pkgs/python-packages/clnrest/default.nix deleted file mode 100644 index 9a45c04..0000000 --- a/pkgs/python-packages/clnrest/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ buildPythonPackage -, clightning -, python -, poetry-core -, flask -, flask-cors -, flask-restx -, flask-socketio -, gevent -, gevent-websocket -, gunicorn -, pyln-client -, json5 -, jsonschema -}: - -let - self = buildPythonPackage rec { - pname = "clnrest"; - version = clightning.version; - format = "pyproject"; - - inherit (clightning) src; - - postUnpack = "sourceRoot=$sourceRoot/plugins/clnrest"; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail 'gevent = "^23.9.0.post1"' 'gevent = "24.2.1"' \ - --replace-fail 'gunicorn = "^21.2.0"' 'gunicorn = "23.0.0"' \ - --replace-fail 'flask = "^2.3.3"' 'flask = "3.0.3"' - - # Add extra required src files that are missing in pyproject.toml - sed -i '/authors/a include = [ { path = "utilities", format = ["sdist", "wheel"] } ]' pyproject.toml - ''; - - nativeBuildInputs = [ poetry-core ]; - - # From https://github.com/ElementsProject/lightning/blob/master/plugins/clnrest/pyproject.toml - propagatedBuildInputs = [ - flask - flask-cors - flask-restx - flask-socketio - gevent - gevent-websocket - gunicorn - json5 - pyln-client - ]; - - postInstall = '' - makeWrapper ${python}/bin/python $out/bin/clnrest \ - --set NIX_PYTHONPATH ${python.pkgs.makePythonPath self.propagatedBuildInputs} \ - --add-flags "$out/lib/${python.libPrefix}/site-packages/clnrest.py" - ''; - }; -in - self diff --git a/pkgs/python-packages/default.nix b/pkgs/python-packages/default.nix index 7445beb..ca6a33c 100644 --- a/pkgs/python-packages/default.nix +++ b/pkgs/python-packages/default.nix @@ -10,7 +10,8 @@ rec { pyln-proto = clightningPkg ./pyln-proto; pyln-bolt7 = clightningPkg ./pyln-bolt7; pylightning = clightningPkg ./pylightning; - clnrest = clightningPkg ./clnrest; + # TODO: Remove after 2026-05-09 + clnrest = throw "`nbPython3Packages.clnrest` has been replaced with nix-bitcoin pkg `clnrest` (Rust rewrite)"; # Packages only used by joinmarket bencoderpyx = callPackage ./bencoderpyx {};