Don't test installing a plugin under valgrind. There's no way to
increase reckless' (completely reasonable) 15 seconds timeout, and that
can happen under valgrind & CI:
```
def test_reckless_uv_install(node_factory):
node = get_reckless_node(node_factory)
node.start()
r = reckless([f"--network={NETWORK}", "-v", "install", "testpluguv"],
dir=node.lightning_dir)
> assert r.returncode == 0
E assert 1 == 0
E + where 1 = self.returncode, self.stdout, self.stderr.returncode
tests/test_reckless.py:359: AssertionError
...
***RECKLESS STDERR***
config file not found: /tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/regtest/config
press [Y] to create one now.
config file not found: /tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/reckless/regtest-reckless.conf
config file not found: /tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/reckless/.sources
Traceback (most recent call last):
File "/home/runner/work/lightning/lightning/tools/reckless", line 2091, in <module>
log.add_result(args.func(target))
File "/home/runner/work/lightning/lightning/tools/reckless", line 1524, in install
return _enable_installed(installed, plugin_name)
File "/home/runner/work/lightning/lightning/tools/reckless", line 1476, in _enable_installed
if enable(installed.name):
File "/home/runner/work/lightning/lightning/tools/reckless", line 1647, in enable
lightning_cli('plugin', 'start', path)
File "/home/runner/work/lightning/lightning/tools/reckless", line 1613, in lightning_cli
clncli = run(cmd, stdout=PIPE, stderr=PIPE, check=False, timeout=timeout)
File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 505, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 1154, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 2022, in _communicate
self._check_timeout(endtime, orig_timeout, stdout, stderr)
File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 1198, in _check_timeout
raise TimeoutExpired(
subprocess.TimeoutExpired: Command '['/home/runner/work/lightning/lightning/cli/lightning-cli', '--network=regtest', '--lightning-dir=/tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1', 'plugin', 'start', '/tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/reckless/testpluguv/testpluguv.py']' timed out after 15 seconds
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Python was installing `pyln-client` directly from the server for testplugpass plugin. This commit is updating the requirements.txt file to install pyln-client with absolute local path.
Also redirect config creation prompts to stderr in order to not interfere
with json output on stdout.
Changelog-Added: reckless provides json output with option flag -j/--json
This uses pip to install to a venv when the dependencies are specified
with requirements.txt and poetry when it's present on the system and the
plugin has a pyproject.toml.
The directory structure will be:
reckless/
source/ (original plugin code here)
plugin_entrypoint (original entrypoint)
plugin_name (symlink or wrapper to activate venv)
.metadata (installation information)
.venv/ (python virtual environment)
The wrapper matches the naming of the original plugin entrypoint. The
shebang is modified to use the virtual environment's python binary,
then the original plugin is imported as a module and executed as though
it was run directly.
Changelog-Changed: reckless installs python plugins in virtual environments
Abstracts search and directory traversal. Adds support for installing
from a local git repository, a local directory, or a web hosted git repo
without relying on an api.
Changelog-Changed: Reckless can now install directly from local sources.
Avoids failing the test with the pip warning:
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
reported by: @ksedgwic
Changelog-None