mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-14 12:02:46 +02:00
chore: deprecate poetry for uv; update dependencies
This commit is contained in:
parent
6b3acf0239
commit
44385ca40c
9 changed files with 1959 additions and 4722 deletions
27
Makefile
27
Makefile
|
|
@ -16,9 +16,9 @@ help:
|
||||||
@echo "To test the project type 'make test'"
|
@echo "To test the project type 'make test'"
|
||||||
@echo "To assess test coverage type 'make coverage'"
|
@echo "To assess test coverage type 'make coverage'"
|
||||||
@echo "To generate the requirements.txt file for pip type 'make update-requirements-file'"
|
@echo "To generate the requirements.txt file for pip type 'make update-requirements-file'"
|
||||||
@echo "To sync current changes to a blitz for testing, type 'make sync-to-blitz'.\n ℹ️ Adjust connection values in scripts/push_to_blitz.sh"
|
@echo "To sync current changes to a blitz for testing, type 'make sync-to-blitz'.\n ℹ️ Adjust connection values in scripts/push_to_blitz.sh"
|
||||||
@echo "To generate the client libraries type 'make generate-client-libs'"
|
@echo "To generate the client libraries type 'make generate-client-libs'"
|
||||||
@echo "To build the Docker regtest image type 'make docker-regtest-image'.\n ℹ️ The image will be available to docker as 'blitz_api'"
|
@echo "To build the Docker regtest image type 'make docker-regtest-image'.\n ℹ️ The image will be available to docker as 'blitz_api'"
|
||||||
@echo "To list all celery tasks type 'make celery-list-tasks'"
|
@echo "To list all celery tasks type 'make celery-list-tasks'"
|
||||||
@echo "To manually trigger a celery task type 'make celery-run-task [TASK_NAME TASK_ARGS TASK_KWARGS]'"
|
@echo "To manually trigger a celery task type 'make celery-run-task [TASK_NAME TASK_ARGS TASK_KWARGS]'"
|
||||||
@echo "------------------------------------"
|
@echo "------------------------------------"
|
||||||
|
|
@ -26,32 +26,33 @@ help:
|
||||||
clean:
|
clean:
|
||||||
echo "Removing htmlcov folder and .coverage file"
|
echo "Removing htmlcov folder and .coverage file"
|
||||||
rm -rf htmlcov .coverage
|
rm -rf htmlcov .coverage
|
||||||
poetry run python -m pyclean .
|
uv run python -m pyclean .
|
||||||
|
|
||||||
install:
|
install:
|
||||||
poetry run python -m pip install -r requirements.txt
|
uv pip install -r requirements.txt
|
||||||
|
|
||||||
install-dev:
|
install-dev:
|
||||||
poetry install
|
# This command reads pyproject.toml and installs all dependencies (main + dev)
|
||||||
|
uv sync
|
||||||
|
|
||||||
run:
|
run:
|
||||||
poetry run python -m uvicorn app.main:app --reload
|
uv run python -m uvicorn app.main:app --reload
|
||||||
|
|
||||||
test:
|
test:
|
||||||
poetry run python -m pytest
|
uv run python -m pytest
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
poetry run python -m coverage run --source=. -m pytest
|
uv run python -m coverage run --source=. -m pytest
|
||||||
poetry run python -m coverage html
|
uv run python -m coverage html
|
||||||
|
|
||||||
update-requirements-file:
|
update-requirements-file:
|
||||||
poetry update && poetry export --without dev --output requirements.txt
|
uv pip compile --all-extras --output-file requirements.txt pyproject.toml
|
||||||
|
|
||||||
sync-to-blitz:
|
sync-to-blitz:
|
||||||
bash scripts/sync_to_blitz.sh
|
bash scripts/sync_to_blitz.sh
|
||||||
|
|
||||||
generate-client-libs:
|
generate-client-libs:
|
||||||
poetry run python gen_client_libs.py
|
uv run python gen_client_libs.py
|
||||||
|
|
||||||
docker-regtest-image:
|
docker-regtest-image:
|
||||||
docker build -f Dockerfile.regtest -t blitz_api .
|
docker build -f Dockerfile.regtest -t blitz_api .
|
||||||
|
|
@ -67,10 +68,10 @@ disable-remote-debugging:
|
||||||
|
|
||||||
celery-list-tasks:
|
celery-list-tasks:
|
||||||
@echo "Listing registered Celery tasks..."
|
@echo "Listing registered Celery tasks..."
|
||||||
@poetry run celery -A $(CELERY_APP) inspect registered
|
@uv run celery -A $(CELERY_APP) inspect registered
|
||||||
|
|
||||||
celery-run-task:
|
celery-run-task:
|
||||||
@echo "Manually triggering Celery task: $(TASK_NAME)"
|
@echo "Manually triggering Celery task: $(TASK_NAME)"
|
||||||
@echo " Args: $(TASK_ARGS)"
|
@echo " Args: $(TASK_ARGS)"
|
||||||
@echo " Kwargs: $(TASK_KWARGS)"
|
@echo " Kwargs: $(TASK_KWARGS)"
|
||||||
@poetry run celery -A $(CELERY_APP) call $(TASK_NAME) --args=$(TASK_ARGS) --kwargs=$(TASK_KWARGS)
|
@uv run celery -A $(CELERY_APP) call $(TASK_NAME) --args=$(TASK_ARGS) --kwargs=$(TASK_KWARGS)
|
||||||
|
|
|
||||||
20
devenv.lock
20
devenv.lock
|
|
@ -3,10 +3,10 @@
|
||||||
"devenv": {
|
"devenv": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "src/modules",
|
"dir": "src/modules",
|
||||||
"lastModified": 1746707904,
|
"lastModified": 1762706931,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv",
|
"repo": "devenv",
|
||||||
"rev": "fada79d97f2066c444766d039b0a62affd3e3cab",
|
"rev": "9a8147b9345ecbb1321890ce7603df1507b1125d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -19,10 +19,10 @@
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733328505,
|
"lastModified": 1761588595,
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -40,10 +40,10 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746537231,
|
"lastModified": 1762441963,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "fa466640195d38ec97cf0493d6d6882bc4d14969",
|
"rev": "8e7576e79b88c16d7ee3bbd112c8d90070832885",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -74,10 +74,10 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1745934659,
|
"lastModified": 1761313199,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv-nixpkgs",
|
"repo": "devenv-nixpkgs",
|
||||||
"rev": "fbc071e5c11e23fba50037de37268e3d8a1858eb",
|
"rev": "d1c30452ebecfc55185ae6d1c983c09da0c274ff",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -89,10 +89,10 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746576598,
|
"lastModified": 1762482733,
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55",
|
"rev": "e1ebeec86b771e9d387dd02d82ffdc77ac753abc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
39
devenv.nix
39
devenv.nix
|
|
@ -57,18 +57,16 @@
|
||||||
lndDataDir = "${dataDir}/lnd";
|
lndDataDir = "${dataDir}/lnd";
|
||||||
clnDataDir = "${dataDir}/cln";
|
clnDataDir = "${dataDir}/cln";
|
||||||
|
|
||||||
pkgs-unstable = import inputs.nixpkgs-unstable {system = pkgs.stdenv.system;};
|
pkgs-unstable = import inputs.nixpkgs-unstable {inherit (pkgs.stdenv) system;};
|
||||||
in {
|
in {
|
||||||
# https://devenv.sh/basics/
|
|
||||||
env.GREET = "devenv";
|
|
||||||
|
|
||||||
languages = {
|
languages = {
|
||||||
python = {
|
python = {
|
||||||
enable = true;
|
enable = true;
|
||||||
poetry = {
|
# 3.11 is default on RaspiBlitz 1.12
|
||||||
|
package = pkgs-unstable.python311;
|
||||||
|
uv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
activate.enable = true;
|
package = pkgs-unstable.uv;
|
||||||
package = pkgs-unstable.poetry;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -123,44 +121,21 @@ in {
|
||||||
nu ./scripts/fake_blitz_scripts/update_redis_values.nu
|
nu ./scripts/fake_blitz_scripts/update_redis_values.nu
|
||||||
'';
|
'';
|
||||||
celery_worker.exec = ''
|
celery_worker.exec = ''
|
||||||
poetry run celery -A app.celery_app worker --loglevel=info
|
uv run celery -A app.celery_app worker --loglevel=info
|
||||||
'';
|
'';
|
||||||
celery_beat.exec = ''
|
celery_beat.exec = ''
|
||||||
poetry run celery -A app.celery_app beat --loglevel=info
|
uv run celery -A app.celery_app beat --loglevel=info
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://devenv.sh/services/
|
|
||||||
services = {
|
services = {
|
||||||
redis.enable = true;
|
redis.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://devenv.sh/tasks/
|
|
||||||
# tasks = {
|
|
||||||
# "myproj:setup".exec = "mytool build";
|
|
||||||
# "devenv:enterShell".after = [ "myproj:setup" ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
enterShell = ''
|
enterShell = ''
|
||||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${
|
||||||
with pkgs-unstable;
|
with pkgs-unstable;
|
||||||
lib.makeLibraryPath [stdenv.cc.cc.lib]
|
lib.makeLibraryPath [stdenv.cc.cc.lib]
|
||||||
}"
|
}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# https://devenv.sh/tests/
|
|
||||||
# disable tests for now. They don't work well, yet
|
|
||||||
# enterTest = ''
|
|
||||||
# echo "Running tests"
|
|
||||||
# wait_for_port 18443
|
|
||||||
# bitcoin-cli -regtest --datadir=${bitcoinDataDir} createwallet testwallet
|
|
||||||
# bitcoin-cli -regtest --datadir=${bitcoinDataDir} -generate 160
|
|
||||||
#
|
|
||||||
# lncli --chain=bitcoin --network=regtest --lnddir=${lndDataDir} getinfo
|
|
||||||
# '';
|
|
||||||
|
|
||||||
# https://devenv.sh/pre-commit-hooks/
|
|
||||||
# pre-commit.hooks.shellcheck.enable = true;
|
|
||||||
|
|
||||||
# See full reference at https://devenv.sh/reference/options/
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,6 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
poetry2nix = {
|
|
||||||
url = "github:fusion44/poetry2nix/nb";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
|
@ -63,6 +59,7 @@
|
||||||
ruff-lsp
|
ruff-lsp
|
||||||
redis
|
redis
|
||||||
pueue
|
pueue
|
||||||
|
sshpass
|
||||||
|
|
||||||
bitcoind
|
bitcoind
|
||||||
lnd
|
lnd
|
||||||
|
|
|
||||||
2994
poetry.lock
generated
2994
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,52 +1,59 @@
|
||||||
[tool.poetry]
|
[project]
|
||||||
name = "blitz_api"
|
name = "blitz_api"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
description = "A backend for the Raspiblitz project"
|
description = "A backend for the Raspiblitz project"
|
||||||
authors = ["fusion44 <some.fusion@gmail.com>"]
|
authors = [{ name = "fusion44", email = "some.fusion@gmail.com" }]
|
||||||
|
requires-python = ">=3.11,<3.13"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
packages = [
|
dependencies = [
|
||||||
{ include = "app" },
|
"fastapi[standard-no-fastapi-cloud-cli]==0.120.4",
|
||||||
|
"fastapi-plugins[redis]==0.14.0",
|
||||||
|
"starlette==0.49.1",
|
||||||
|
"anyio==4.9.0",
|
||||||
|
"uvicorn[standard]==0.34.2",
|
||||||
|
"pydantic==2.10.6",
|
||||||
|
"pydantic-core==2.27.2",
|
||||||
|
"typing-extensions==4.12.2",
|
||||||
|
"pyjwt==2.10.1",
|
||||||
|
"python-decouple==3.8",
|
||||||
|
"psutil==7.0.0",
|
||||||
|
"requests==2.32.4",
|
||||||
|
"pyzmq==26.4.0",
|
||||||
|
"aiohttp==3.12.14",
|
||||||
|
"grpcio==1.71.0",
|
||||||
|
"grpcio-tools==1.71.0",
|
||||||
|
"protobuf==5.29.5",
|
||||||
|
"deepdiff==8.6.1",
|
||||||
|
"loguru==0.7.3",
|
||||||
|
"celery[redis]==5.5.2",
|
||||||
|
# Required for the fastapi-plugins[redis]
|
||||||
|
# Maybe remove and use redis-py directly instead as this is deprecated
|
||||||
|
"async_timeout==5.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[project.scripts]
|
||||||
python = "^3.12 | ^3.11"
|
api = "app.server:main"
|
||||||
fastapi = {extras = ["standard"], version = "0.115.12"}
|
|
||||||
fastapi-plugins = "0.13.2"
|
|
||||||
starlette = "0.45.3"
|
|
||||||
anyio = "4.9.0"
|
|
||||||
uvicorn = {extras = ["standard"], version = "0.34.2"}
|
|
||||||
pydantic = "2.10.6"
|
|
||||||
pydantic-core = "2.27.2"
|
|
||||||
typing-extensions = "4.12.2"
|
|
||||||
pyjwt = "2.10.1"
|
|
||||||
python-decouple = "3.8"
|
|
||||||
psutil = "7.0.0"
|
|
||||||
requests = "2.32.3"
|
|
||||||
pyzmq = "26.4.0"
|
|
||||||
aiohttp = "3.11.18"
|
|
||||||
grpcio = "1.71.0"
|
|
||||||
grpcio-tools = "1.71.0"
|
|
||||||
protobuf = "5.29.3"
|
|
||||||
deepdiff = "8.4.2"
|
|
||||||
loguru = "0.7.3"
|
|
||||||
celery = {extras = ["redis"], version = "5.5.2"}
|
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = [
|
||||||
|
"pytest==8.3.5",
|
||||||
|
"pytest-asyncio==0.25.3",
|
||||||
|
"coverage==7.8.0",
|
||||||
|
"ruff==0.9.6",
|
||||||
|
"debugpy==1.8.14",
|
||||||
|
"click==8.1.8",
|
||||||
|
"watchfiles==0.24.0",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.hatch.build.targets.sdist]
|
||||||
pytest = "8.3.5"
|
include = ["app"]
|
||||||
pytest-asyncio = "0.25.3"
|
|
||||||
coverage = "7.8.0"
|
|
||||||
ruff = "0.9.6"
|
|
||||||
debugpy = "1.8.14"
|
|
||||||
click = "8.1.8"
|
|
||||||
watchfiles = "0.24.0"
|
|
||||||
|
|
||||||
[tool.poetry.requires-plugins]
|
[tool.hatch.build.targets.wheel]
|
||||||
poetry-plugin-export = ">=1.8"
|
include = ["app"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["hatchling"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
profile = "black"
|
profile = "black"
|
||||||
|
|
@ -97,6 +104,3 @@ target-version = "py311"
|
||||||
[tool.ruff.mccabe]
|
[tool.ruff.mccabe]
|
||||||
# Unlike Flake8, default to a complexity level of 10.
|
# Unlike Flake8, default to a complexity level of 10.
|
||||||
max-complexity = 10
|
max-complexity = 10
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
|
||||||
api = "app.server:main"
|
|
||||||
|
|
|
||||||
1851
requirements.txt
1851
requirements.txt
File diff suppressed because it is too large
Load diff
|
|
@ -72,7 +72,7 @@ fi
|
||||||
|
|
||||||
# Needs sshpass installed
|
# Needs sshpass installed
|
||||||
echo "# syncing local code to: ${remote}"
|
echo "# syncing local code to: ${remote}"
|
||||||
sshpass -p "$passwordA" rsync -rvz --exclude .venv/ --exclude .env --exclude test_env_data/ --exclude .git/ -e "ssh -p ${sshPort}" $local $remote
|
sshpass -p "$passwordA" rsync -rvz --exclude .devenv/ --exclude .venv/ --exclude .env --exclude test_env_data/ --exclude .git/ -e "ssh -p ${sshPort}" $local $remote
|
||||||
result=$?
|
result=$?
|
||||||
echo "result(${result})"
|
echo "result(${result})"
|
||||||
if [ "$result" != "0" ]; then
|
if [ "$result" != "0" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue