Skip to content

Commit a0fe017

Browse files
king-11madelinevibes
authored andcommitted
chore: update docs for uv
update commands and usage for uv
1 parent 570c631 commit a0fe017

File tree

9 files changed

+55
-39
lines changed

9 files changed

+55
-39
lines changed

contrib/pyln-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ installing into your python3 environment:
2121
```bash
2222
git clone https://github.com/ElementsProject/lightning.git
2323
cd lightning/contrib/pyln-client
24-
poetry install
24+
uv sync
2525
```
2626

2727
This will add links to the library into your environment so changing the

contrib/pyln-proto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ installing into your python3 environment:
2121
```bash
2222
git clone https://github.com/ElementsProject/lightning.git
2323
cd lightning/contrib/pyln-proto
24-
poetry install
24+
uv sync
2525
```
2626

2727
This will add links to the library into your environment so changing the

contrib/pyln-testing/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ installing into your python3 environment:
2323
```bash
2424
git clone https://github.com/ElementsProject/lightning.git
2525
cd lightning/contrib/pyln-testing
26-
poetry install
26+
uv sync --extra grpc
2727
```
2828

2929
This will add links to the library into your environment so changing the

doc/contribute-to-core-lightning/contributor-workflow.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,37 @@ It will also print out (to stderr) the gdb command for manual connection. The s
3535
make -j$(nproc)
3636
```
3737

38+
## Building Python Packages
39+
40+
Core Lightning includes several Python packages in the workspace that can be built individually or all at once:
41+
42+
```shell
43+
# Build all Python packages
44+
make pyln-build-all
45+
46+
# Build individual packages
47+
make pyln-build-client
48+
make pyln-build-proto
49+
make pyln-build-testing
50+
make pyln-build-grpc-proto
51+
52+
# Build bolt specification packages
53+
make pyln-build-bolt1
54+
make pyln-build-bolt2
55+
make pyln-build-bolt4
56+
make pyln-build-bolt7
57+
58+
# Build wss-proxy plugin
59+
make pyln-build-wss-proxy
60+
```
61+
62+
You can also build packages directly with uv:
63+
64+
```shell
65+
uv build contrib/pyln-client/
66+
uv build contrib/pyln-proto/
67+
```
68+
3869
## Making BOLT Modifications
3970

4071
All of code for marshalling/unmarshalling BOLT protocol messages is generated directly from the spec. These are pegged to the BOLTVERSION, as specified in `Makefile`.

doc/contribute-to-core-lightning/testing.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ There are four kinds of tests:
3939

4040
- **blackbox tests** - These tests setup a mini-regtest environment and test lightningd as a whole. They can be run individually:
4141

42-
`PYTHONPATH=contrib/pyln-client:contrib/pyln-testing:contrib/pyln-proto:contrib/pyln-grpc-proto py.test -v tests/`
42+
`uv run python -m pytest -v tests/`
43+
44+
Note: For testing that requires grpc functionality, ensure you have the grpc extras installed: `uv sync --extra grpc`
4345

4446
You can also append `-k TESTNAME` to run a single test. Environment variables `DEBUG_SUBD=[<path>:]<subdaemon>` (where path must match the end of the lightning daemon path, for matching only one of several lightningd instances) and `TIMEOUT=<seconds>` can be useful for debugging subdaemons on individual tests, and `DEBUG_LIGHTNINGD` for attaching a debugger to each `lightningd` instance created.
4547

4648
Alternatively, to run a specific test via the `Makefile`, you can specify the test by setting the environment variable `PYTEST_TESTS`:
4749

4850
`PYTEST_TESTS="tests/test_askrene.py::test_layers" make pytest`
51+
52+
Or run tests directly with uv:
53+
54+
`uv run python -m pytest tests/test_askrene.py::test_layers -v`
4955

5056
- **pylightning tests** - will check contrib pylightning for codestyle and run the tests in `contrib/pylightning/tests` afterwards:
5157

doc/developers-guide/app-development/grpc.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,10 @@ The gRPC interface is described in the [protobuf file](https://github.com/Elemen
3535

3636
In this tutorial, we walk through the steps for Python, however they are mostly the same for other languages. For instance, if you're developing in Rust, use [`tonic-build`](https://docs.rs/tonic-build/latest/tonic_build/) to generate the bindings. For other languages, see the official [gRPC docs](https://grpc.io/docs/languages/) on how to generate gRPC client library for your specific language using the protobuf file.
3737

38-
We start by downloading the dependencies and `protoc` compiler:
39-
40-
```shell
41-
pip install grpcio-tools
42-
```
43-
44-
45-
46-
Next we generate the bindings in the current directory:
38+
We generate the bindings in the current directory:
4739

4840
```bash
49-
python -m grpc_tools.protoc \
41+
uv run -m grpc_tools.protoc \
5042
-I path/to/cln-grpc/proto \
5143
path/to/cln-grpc/proto/node.proto \
5244
--python_out=. \

doc/developers-guide/app-development/json-rpc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Alternatively you can also install the development version to get access to curr
3434
```shell
3535
git clone https://github.com/ElementsProject/lightning.git
3636
cd lightning/contrib/pyln-client
37-
poetry install
37+
uv sync
3838
```
3939

4040

doc/getting-started/getting-started/installation.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ sudo apt-get install -y \
7979
jq autoconf automake build-essential git libtool libsqlite3-dev libffi-dev \
8080
python3 python3-pip net-tools zlib1g-dev libsodium-dev gettext
8181
pip3 install --upgrade pip
82-
pip3 install --user poetry
82+
curl -LsSf https://astral.sh/uv/install.sh | sh
8383
```
8484

85-
(If installing `poetry` with `pip` as above fails, try installing it with the [official poetry installer](https://python-poetry.org/docs/#installing-with-the-official-installer).)
85+
After installing uv, restart your shell or run `source ~/.bashrc` to ensure `uv` is in your PATH.
8686

8787

8888
If you don't have Bitcoin installed locally you'll need to install that as well. It's now available via [snapd](https://snapcraft.io/bitcoin-core).
@@ -113,7 +113,6 @@ For development or running tests, get additional dependencies:
113113
```shell
114114
sudo apt-get install -y valgrind libpq-dev shellcheck cppcheck \
115115
libsecp256k1-dev lowdown
116-
pip3 install pytest
117116
```
118117

119118
If you can't install `lowdown`, a version will be built in-tree.
@@ -134,9 +133,9 @@ There are two ways to build core lightning, and this depends on how you want use
134133
To build CLN for production:
135134

136135
```shell
137-
poetry install
136+
uv sync --all-extras --all-groups
138137
./configure
139-
RUST_PROFILE=release poetry run make
138+
RUST_PROFILE=release uv run make
140139
sudo RUST_PROFILE=release make install
141140
```
142141

@@ -147,16 +146,10 @@ sudo RUST_PROFILE=release make install
147146
To build CLN for development:
148147

149148
```shell
150-
poetry shell
151-
```
152-
153-
This will put you in a new shell to enter the following commands:
154-
155-
```shell
156-
poetry install
149+
uv sync --all-extras --all-groups
157150
./configure
158-
make
159-
make check VALGRIND=0
151+
uv run make
152+
uv run make check VALGRIND=0
160153
```
161154

162155
Optionally, add `-j$(nproc)` after `make` to speed up compilation. (e.g. `make -j$(nproc)`)

plugins/grpc-plugin/README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if they don't already exist:
2323
- `client.pem` and `client-key.pem`: this is an example identity that
2424
can be used by a client to connect to the plugin, and issue
2525
requests. It is also signed by the CA.
26-
26+
2727
These files are generated with sane defaults, however you can generate
2828
custom certificates should you require some changes (see below for
2929
details).
@@ -39,16 +39,10 @@ bindings.
3939
In this example we walk through the steps for python, however they are
4040
mostly the same for other languages.
4141

42-
We start by downloading the dependencies and `protoc` compiler:
43-
44-
```bash
45-
pip install grpcio-tools
46-
```
47-
48-
Next we generate the bindings in the current directory:
42+
We generate the bindings in the current directory:
4943

5044
```bash
51-
python -m grpc_tools.protoc \
45+
uv run -m grpc_tools.protoc \
5246
-I path/to/cln-grpc/proto \
5347
path/to/cln-grpc/proto/node.proto \
5448
--python_out=. \
@@ -62,7 +56,7 @@ This will generate two files in the current directory:
6256
exchanging with the server.
6357
- `node_pb2_grpc.py`: the service and method stubs representing the
6458
server-side methods as local objects and associated methods.
65-
59+
6660
And finally we can use the generated stubs and mTLS identity to
6761
connect to the node:
6862

0 commit comments

Comments
 (0)