Skip to content

Commit 6c1055a

Browse files
committed
currencyrate: migrate to uv shebang
1 parent 02b548e commit 6c1055a

File tree

5 files changed

+1546
-11
lines changed

5 files changed

+1546
-11
lines changed

currencyrate/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ different backends and taking the median. It caches results for an hour.
55

66
## Installation
77

8+
You need [uv](https://docs.astral.sh/uv/getting-started/installation/) to run this
9+
plugin like a binary. After `uv` is installed you can simply run
10+
11+
```
12+
lightning-cli plugin start /path/to/currencyrate.py
13+
```
14+
815
For general plugin installation instructions see the repos main
916
[README.md](https://github.com/lightningd/plugins/blob/master/README.md#Installation)
1017

currencyrate/currencyrate.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env -S uv run --script
2+
3+
# /// script
4+
# requires-python = ">=3.9.2"
5+
# dependencies = [
6+
# "cachetools>=5.3.3",
7+
# "pyln-client>=24.11",
8+
# "requests[socks]>=2.32.2",
9+
# "urllib3>=2.2.2",
10+
# ]
11+
# ///
12+
213
try:
314
import statistics
415
from collections import namedtuple
@@ -15,11 +26,13 @@
1526

1627
getmanifest = json.loads(sys.stdin.readline())
1728
print(
18-
json.dumps({
19-
"jsonrpc": "2.0",
20-
"id": getmanifest["id"],
21-
"result": {"disable": str(err)},
22-
})
29+
json.dumps(
30+
{
31+
"jsonrpc": "2.0",
32+
"id": getmanifest["id"],
33+
"result": {"disable": str(err)},
34+
}
35+
)
2336
)
2437
sys.exit(1)
2538

currencyrate/pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[project]
2+
name = "currencyrate"
3+
version = "0.1.0"
4+
description = "Provides Bitcoin currency conversion functions using various different backends"
5+
readme = "README.md"
6+
requires-python = ">=3.9.2"
7+
8+
[dependency-groups]
9+
dev = [
10+
"pytest>=7.4,<9",
11+
"pytest-xdist>=3.7,<4",
12+
"pytest-timeout>=2.4,<3",
13+
"pyln-testing>=24.11.1",
14+
"pyln-client>=24.11.1",
15+
"pyln-proto>=24.11.1",
16+
]

currencyrate/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)