Skip to content

Commit 6e9cab3

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 6e9cab3

File tree

16 files changed

+3400
-1573
lines changed

16 files changed

+3400
-1573
lines changed

contrib/cln-tracer/pyproject.toml

Lines changed: 11 additions & 10 deletions
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

Lines changed: 13 additions & 14 deletions
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

Lines changed: 15 additions & 17 deletions
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+
[dependency-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 = { workspace = true }
23+
pyln-bolt7 = { workspace = true }

contrib/pyln-grpc-proto/poetry.lock

Lines changed: 0 additions & 834 deletions
This file was deleted.
Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
1-
2-
[tool.poetry]
1+
[project]
32
name = "pyln-grpc-proto"
43
version = "0.1.2"
54
description = "The compiled GRPC proto for CLN"
6-
authors = ["Christian Decker <[email protected]>"]
7-
license = "MIT"
5+
authors = [{ name = "Christian Decker", email = "[email protected]" }]
6+
license = { text = "MIT" }
87
readme = "README.md"
8+
requires-python = ">=3.8,<4.0"
9+
dependencies = ["grpcio", "protobuf3"]
910

10-
packages = [
11-
{ include = "pyln/grpc/*.py" },
12-
]
13-
14-
include = [
15-
{ path = "pyln/grpc", format = ["wheel", "sdist"] }
16-
]
17-
18-
[tool.poetry.dependencies]
19-
python = "^3.8"
20-
grpcio = "*"
21-
protobuf3 = "*"
11+
[dependency-groups]
12+
dev = ["grpcio", "twine>=4.0.2", "mypy-protobuf<3.5.0", "grpcio-tools>=1.59.2"]
2213

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"
14+
[tool.hatch.build.targets.wheel]
15+
packages = ["pyln/grpc"]
2816

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

contrib/pyln-grpc-proto/uv.lock

Lines changed: 155 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/pyln-proto/pyproject.toml

Lines changed: 20 additions & 17 deletions
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+
[dependency-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"
Lines changed: 17 additions & 12 deletions
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+
[dependency-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 = { workspace = true }
Lines changed: 17 additions & 12 deletions
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+
[dependency-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 = { workspace = true }
Lines changed: 17 additions & 12 deletions
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+
[dependency-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 = { workspace = true }
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
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"
5+
authors = [{ name = "Rusty Russell" }]
6+
license = { text = "BSD-MIT" }
7+
requires-python = ">=3.8,<4.0"
8+
dependencies = []
79

8-
packages = [
9-
{ include = "pyln/spec/bolt7" },
10-
]
10+
[dependency-groups]
11+
dev = ["pyln-proto>=0.10.2"]
1112

12-
[tool.poetry.dependencies]
13-
python = "^3.8"
14-
15-
[tool.poetry.dev-dependencies]
16-
pyln-proto = "^0.10.2"
13+
[tool.hatch.build.targets.wheel]
14+
packages = ["pyln/spec/bolt7"]
1715

1816
[build-system]
19-
requires = ["poetry-core>=1.0.0"]
20-
build-backend = "poetry.core.masonry.api"
17+
requires = ["hatchling>=1.0.0"]
18+
build-backend = "hatchling.build"
19+
20+
[tool.uv.sources]
21+
pyln-proto = { workspace = true }

0 commit comments

Comments
 (0)