Skip to content

Commit d1b96d8

Browse files
committed
sauron: migrate to uv shebang
1 parent 02b548e commit d1b96d8

File tree

5 files changed

+1533
-5
lines changed

5 files changed

+1533
-5
lines changed

sauron/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This is still a WIP, so is the API C-lightning side. So not to be used for real.
1414
### Run
1515

1616
You need to:
17+
- have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed
1718
- disable the default Bitcoin backend (`bcli`)
1819
- register sauron
1920
- provide the API endpoint you want to use

sauron/pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[project]
2+
name = "sauron"
3+
version = "0.1.0"
4+
description = "A Bitcoin backend plugin relying on Esplora"
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+
]

sauron/requirements.txt

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

sauron/sauron.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
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+
# pyln-client>=24.11
7+
# requests[socks]>=2.23.0
8+
# ]
9+
# ///
10+
211
import requests
312
import sys
413
import time
@@ -210,7 +219,7 @@ def estimatefees(plugin, **kwargs):
210219
{"blocks": 2, "feerate": very_urgent},
211220
{"blocks": 6, "feerate": urgent},
212221
{"blocks": 12, "feerate": normal},
213-
{"blocks": 144, "feerate": slow}
222+
{"blocks": 144, "feerate": slow},
214223
]
215224

216225
return {
@@ -223,7 +232,7 @@ def estimatefees(plugin, **kwargs):
223232
"min_acceptable": slow // 2,
224233
"max_acceptable": very_urgent * 10,
225234
"feerate_floor": feerate_floor,
226-
"feerates": feerates
235+
"feerates": feerates,
227236
}
228237

229238

0 commit comments

Comments
 (0)