code quality fixes and cleanup

This commit is contained in:
Riccardo Balbo 2024-09-07 09:09:22 +00:00
commit 2bbbcd4d65
32 changed files with 4943 additions and 1368 deletions

View file

@ -1,33 +1,28 @@
{
"name": "lnbits_nwc_provider",
"image": "mcr.microsoft.com/devcontainers/python:1-3.9-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {
}
},
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/start.sh,target=/start-lnbits.sh,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/setup.sh,target=/setup.sh,type=bind",
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"containerEnv": {
"IS_DEV_CONTAINER": "true",
},
"postCreateCommand": "/bin/bash /setup.sh ${containerWorkspaceFolder}",
"postStartCommand": "/bin/bash /start-lnbits.sh",
"forwardPorts": [
5000
],
"customizations": {
"vscode": {
"settings": {
// "python.pythonPath": "/opt/python/bin/python3.9"
}
}
},
"runArgs": ["--network", "host"]
"name": "lnbits_nwc_provider",
"image": "mcr.microsoft.com/devcontainers/python:1-3.9-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/start.sh,target=/start-lnbits.sh,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/setup.sh,target=/setup.sh,type=bind",
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"containerEnv": {
"IS_DEV_CONTAINER": "true"
},
"postCreateCommand": "/bin/bash /setup.sh ${containerWorkspaceFolder}",
"postStartCommand": "/bin/bash /start-lnbits.sh",
"forwardPorts": [5000],
"customizations": {
"vscode": {
"settings": {
"python.analysis.extraPaths": ["/home/vscode/lnbits"],
"python.pythonPath": "/home/vscode/python"
// "python.pythonPath": "/opt/python/bin/python3.9"
}
}
},
"runArgs": ["--network", "host"]
}

View file

@ -1,4 +1,5 @@
#!/bin/bash
echo $PYTHONPATH
CONTAINER_WORKSPACE_FOLDER=$1
cd $CONTAINER_WORKSPACE_FOLDER
sudo apt update -y
@ -8,14 +9,18 @@ sudo apt-get install -y docker.io
curl -fsSL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
sudo bash /tmp/nodesource_setup.sh
sudo apt-get install -y nodejs
if [ ! -d lnbits ] ; then
git clone https://github.com/lnbits/lnbits.git;
cd $HOME
echo $PWD
if [ ! -d ./lnbits ] ; then
git clone https://github.com/lnbits/lnbits.git lnbits
fi
cd lnbits
echo $PWD
git checkout 0.12.8
poetry env use python3.9
# export VENV_PATH=$(poetry env info -p)
# sudo ln -s $VENV_PATH /opt/python
POETRY_PYTHON_PATH=$(poetry env info -p)/bin/python
ln -sf $POETRY_PYTHON_PATH /home/vscode/python
make bundle
poetry install --no-interaction
mkdir -p lnbits/extensions/
@ -23,4 +28,7 @@ if [ ! -d lnbits/extensions/nwcprovider ] ; then
ln -s $CONTAINER_WORKSPACE_FOLDER lnbits/extensions/nwcprovider
fi
cd $CONTAINER_WORKSPACE_FOLDER
poetry install --no-interaction
npm i prettier
npm i pyright

View file

@ -1,4 +1,4 @@
#!/bin/bash
ln -s $PWD/.devcontainer/.env ./lnbits/.env
cd ./lnbits
ln -s $PWD/.devcontainer/.env $HOME/lnbits/.env
cd $HOME/lnbits
poetry run lnbits