Skip to content

Commit d041488

Browse files
committed
refactor: pyproject.toml poetry to uv + hatch
make use of standard keys for project and dependeny specification - provide sources to run uv build so that it can refer local packages - using hatchling for build as is stock build option - use optional-dependencies.dev for dev-dependencies - add hatch targets for packages and includes where unclear Changelog-Update: use uv and hatchling instead of poetry
1 parent d3c7d2c commit d041488

File tree

14 files changed

+2762
-736
lines changed

14 files changed

+2762
-736
lines changed

contrib/cln-tracer/pyproject.toml

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
[tool.poetry]
1+
[project]
22
name = "cln-tracer"
33
version = "0.1.0"
44
description = ""
5-
authors = ["Christian Decker <[email protected]>"]
5+
authors = [
6+
{name = "Christian Decker", email = "[email protected]"}
7+
]
68
readme = "README.md"
7-
8-
[tool.poetry.dependencies]
9-
python = "^3.8"
10-
bcc = "^0.1.10"
11-
opentelemetry-proto = "^1.21.0"
12-
9+
requires-python = ">=3.8,<4.0"
10+
dependencies = [
11+
"bcc>=0.1.10",
12+
"opentelemetry-proto>=1.21.0"
13+
]
1314

1415
[build-system]
15-
requires = ["poetry-core"]
16-
build-backend = "poetry.core.masonry.api"
16+
requires = ["hatchling>=1.0.0"]
17+
build-backend = "hatchling.build"

contrib/msggen/pyproject.toml

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
[tool.poetry]
1+
[project]
22
name = "msggen"
33
version = "0.1.0"
44
description = "A utility to transform wire messages and JSON-RPC messages to arbitrary target languages."
5-
authors = ["Christian Decker <[email protected]>"]
6-
license = "BSD-MIT"
7-
8-
include = ["msggen/schema.json"]
5+
authors = [{ name = "Christian Decker", email = "[email protected]" }]
6+
license = { text = "BSD-MIT" }
7+
requires-python = ">=3.6,<4.0"
8+
dependencies = []
99

10+
[dependency-groups]
11+
dev = ["pytest>=6.2.5"]
1012

11-
[tool.poetry.dependencies]
12-
python = "^3.6"
13+
[project.scripts]
14+
msggen = "msggen.__main__:main"
1315

14-
[tool.poetry.dev-dependencies]
15-
pytest = "^6.2.5"
16+
[tool.hatch.build.targets.wheel]
17+
include = ["msggen/schema.json"]
1618

1719
[build-system]
18-
requires = ["poetry-core>=1.0.0"]
19-
build-backend = "poetry.core.masonry.api"
20-
21-
[tool.poetry.scripts]
22-
msggen = 'msggen.__main__:main'
20+
requires = ["hatchling>=1.0.0"]
21+
build-backend = "hatchling.build"

contrib/pyln-client/pyproject.toml

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyln-client"
33
version = "25.02"
44
description = "Client library and plugin library for Core Lightning"
5-
authors = ["Christian Decker <[email protected]>"]
6-
license = "BSD-MIT"
5+
authors = [{ name = "Christian Decker", email = "[email protected]" }]
6+
license = { text = "BSD-MIT" }
77
readme = "README.md"
8+
requires-python = ">=3.8,<4.0"
9+
dependencies = ["pyln-proto>=23", "pyln-bolt7>=1.0"]
810

9-
packages = [
10-
{ include = "pyln/client" },
11-
]
11+
[depedency-groups]
12+
dev = ["pytest>=7.0.0", "pyln-bolt7", "pyln-proto"]
1213

13-
[tool.poetry.dependencies]
14-
python = "^3.8"
15-
pyln-proto = ">=23"
16-
pyln-bolt7 = ">=1.0"
17-
18-
[tool.poetry.dev-dependencies]
19-
pytest = "^7"
20-
pyln-bolt7 = { path = "../pyln-spec/bolt7", develop = true }
21-
pyln-proto = { path = "../pyln-proto", develop = true}
14+
[tool.hatch.build.targets.wheel]
15+
packages = ["pyln/client"]
2216

2317
[build-system]
24-
requires = ["poetry-core>=1.0.0"]
25-
build-backend = "poetry.core.masonry.api"
18+
requires = ["hatchling>=1.0.0"]
19+
build-backend = "hatchling.build"
20+
21+
[tool.uv.sources]
22+
pyln-proto = { path = "../pyln-proto" }
23+
pyln-bolt7 = { path = "../pyln-spec/bolt7" }
+11-22
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11

2-
[tool.poetry]
2+
[project]
33
name = "pyln-grpc-proto"
44
version = "0.1.2"
55
description = "The compiled GRPC proto for CLN"
6-
authors = ["Christian Decker <[email protected]>"]
7-
license = "MIT"
6+
authors = [{ name = "Christian Decker", email = "[email protected]" }]
7+
license = { text = "MIT" }
88
readme = "README.md"
9+
requires-python = ">=3.8,<4.0"
10+
dependencies = ["grpcio", "protobuf3"]
911

10-
packages = [
11-
{ include = "pyln/grpc/*.py" },
12-
]
12+
[depedency-groups]
13+
dev = ["grpcio", "twine>=4.0.2", "mypy-protobuf>=3.5.0", "grpcio-tools>=1.59.2"]
1314

14-
include = [
15-
{ path = "pyln/grpc", format = ["wheel", "sdist"] }
16-
]
17-
18-
[tool.poetry.dependencies]
19-
python = "^3.8"
20-
grpcio = "*"
21-
protobuf3 = "*"
22-
23-
[tool.poetry.group.dev.dependencies]
24-
grpcio = "*"
25-
twine = "^4.0.2"
26-
mypy-protobuf = "^3.5.0"
27-
grpcio-tools = "^1.59.2"
15+
[tool.hatch.build.targets.wheel]
16+
packages = ["pyln/grpc"]
2817

2918
[build-system]
30-
requires = ["poetry-core"]
31-
build-backend = "poetry.core.masonry.api"
19+
requires = ["hatchling>=1.0.0"]
20+
build-backend = "hatchling.build"

contrib/pyln-proto/pyproject.toml

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyln-proto"
33
version = "25.02"
44
description = "This package implements some of the Lightning Network protocol in pure python. It is intended for protocol testing and some minor tooling only. It is not deemed secure enough to handle any amount of real funds (you have been warned!)."
5-
authors = ["Christian Decker <[email protected]>"]
6-
license = "BSD-MIT"
5+
authors = [
6+
{name = "Christian Decker", email = "[email protected]"}
7+
]
8+
license = {text = "BSD-MIT"}
79
readme = "README.md"
8-
9-
packages = [
10-
{ include = "pyln/proto" },
10+
requires-python = ">=3.8,<4.0"
11+
dependencies = [
12+
"base58>=2.1.1",
13+
"bitstring>=4.1.0",
14+
"coincurve>=20",
15+
"cryptography>=42",
16+
"PySocks>=1"
1117
]
1218

13-
[tool.poetry.dependencies]
14-
python = "^3.8"
15-
base58 = "^2.1.1"
16-
bitstring = "^4.1.0"
17-
coincurve = "^20"
18-
cryptography = "^42"
19-
PySocks = "^1"
19+
[depedency-groups]
20+
dev = [
21+
"pytest>=7.0.0"
22+
]
2023

21-
[tool.poetry.dev-dependencies]
22-
pytest = "^7"
24+
[tool.hatch.build.targets.wheel]
25+
packages = ["pyln/proto"]
2326

2427
[build-system]
25-
requires = ["poetry-core>=1.0.0"]
26-
build-backend = "poetry.core.masonry.api"
28+
requires = ["hatchling>=1.0.0"]
29+
build-backend = "hatchling.build"
+17-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyln-bolt1"
33
version = "1.0.2.246"
44
description = ""
5-
authors = ["Rusty Russell <[email protected]>"]
6-
license = "MIT"
7-
8-
packages = [
9-
{ include = "pyln/spec/bolt1" },
5+
authors = [
6+
{name = "Rusty Russell", email = "[email protected]"}
107
]
8+
license = {text = "MIT"}
9+
requires-python = ">=3.8,<4.0"
10+
dependencies = []
1111

12-
[tool.poetry.dependencies]
13-
python = "^3.8"
12+
[depedency-groups]
13+
dev = [
14+
"pyln-proto>=0.10.2"
15+
]
1416

15-
[tool.poetry.dev-dependencies]
16-
pyln-proto = "^0.10.2"
17+
[tool.hatch.build.targets.wheel]
18+
packages = ["pyln/spec/bolt1"]
1719

1820
[build-system]
19-
requires = ["poetry-core>=1.0.0"]
20-
build-backend = "poetry.core.masonry.api"
21+
requires = ["hatchling>=1.0.0"]
22+
build-backend = "hatchling.build"
23+
24+
[tool.uv.sources]
25+
pyln-proto = { path = "../../pyln-proto" }
+17-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyln-bolt2"
33
version = "1.0.3.246"
44
description = "A pure python implementation of BOLT2"
5-
authors = ["Rusty Russell <[email protected]>"]
6-
license = "MIT"
7-
8-
packages = [
9-
{ include = "pyln/spec/bolt2" },
5+
authors = [
6+
{name = "Rusty Russell", email = "[email protected]"}
107
]
8+
license = {text = "MIT"}
9+
requires-python = ">=3.8,<4.0"
10+
dependencies = []
1111

12-
[tool.poetry.dependencies]
13-
python = "^3.8"
12+
[depedency-groups]
13+
dev = [
14+
"pyln-proto>=0.10.2"
15+
]
1416

15-
[tool.poetry.dev-dependencies]
16-
pyln-proto = "^0.10.2"
17+
[tool.hatch.build.targets.wheel]
18+
packages = ["pyln/spec/bolt2"]
1719

1820
[build-system]
19-
requires = ["poetry-core>=1.0.0"]
20-
build-backend = "poetry.core.masonry.api"
21+
requires = ["hatchling>=1.0.0"]
22+
build-backend = "hatchling.build"
23+
24+
[tool.uv.sources]
25+
pyln-proto = { path = "../../pyln-proto" }
+17-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyln-bolt4"
33
version = "1.0.4.246"
44
description = "A pure python implementation of BOLT4"
5-
authors = ["Rusty Russell <[email protected]>"]
6-
license = "MIT"
7-
8-
packages = [
9-
{ include = "pyln/spec/bolt4" },
5+
authors = [
6+
{name = "Rusty Russell", email = "[email protected]"}
107
]
8+
license = {text = "MIT"}
9+
requires-python = ">=3.8,<4.0"
10+
dependencies = []
1111

12-
[tool.poetry.dependencies]
13-
python = "^3.8"
12+
[depedency-groups]
13+
dev = [
14+
"pyln-proto>=0.10.2"
15+
]
1416

15-
[tool.poetry.dev-dependencies]
16-
pyln-proto = "^0.10.2"
17+
[tool.hatch.build.targets.wheel]
18+
packages = ["pyln/spec/bolt4"]
1719

1820
[build-system]
19-
requires = ["poetry-core>=1.0.0"]
20-
build-backend = "poetry.core.masonry.api"
21+
requires = ["hatchling>=1.0.0"]
22+
build-backend = "hatchling.build"
23+
24+
[tool.uv.sources]
25+
pyln-proto = { path = "../../pyln-proto" }
+17-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyln-bolt7"
33
version = "1.0.4.246"
44
description = "BOLT7"
5-
authors = ["Rusty Russell"]
6-
license = "BSD-MIT"
7-
8-
packages = [
9-
{ include = "pyln/spec/bolt7" },
5+
authors = [
6+
{name = "Rusty Russell"}
107
]
8+
license = {text = "BSD-MIT"}
9+
requires-python = ">=3.8,<4.0"
10+
dependencies = []
1111

12-
[tool.poetry.dependencies]
13-
python = "^3.8"
12+
[depedency-groups]
13+
dev = [
14+
"pyln-proto>=0.10.2"
15+
]
1416

15-
[tool.poetry.dev-dependencies]
16-
pyln-proto = "^0.10.2"
17+
[tool.hatch.build.targets.wheel]
18+
packages = ["pyln/spec/bolt7"]
1719

1820
[build-system]
19-
requires = ["poetry-core>=1.0.0"]
20-
build-backend = "poetry.core.masonry.api"
21+
requires = ["hatchling>=1.0.0"]
22+
build-backend = "hatchling.build"
23+
24+
[tool.uv.sources]
25+
pyln-proto = { path = "../../pyln-proto" }

0 commit comments

Comments
 (0)