diff --git a/Dockerfile b/Dockerfile index a7a3be9fb..6b4e22c73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ COPY . . RUN poetry config virtualenvs.create false RUN poetry install --only main -RUN poetry run python build.py +RUN poetry run python tools/build.py ENV LNBITS_PORT="5000" ENV LNBITS_HOST="0.0.0.0" diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 43e7e3889..ccfbd692d 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -92,7 +92,7 @@ python3.9 -m venv venv # create the data folder and the .env file mkdir data && cp .env.example .env # build the static files -./venv/bin/python build.py +./venv/bin/python tools/build.py ``` #### Running the server diff --git a/pyproject.toml b/pyproject.toml index 346f0dc88..84104684d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Alan Bits "] [tool.poetry.build] generate-setup-file = false -script = "build.py" +script = "tools/build.py" [tool.poetry.dependencies] python = "^3.10 | ^3.9 | ^3.8 | ^3.7" diff --git a/tests/core/views/test_api.py b/tests/core/views/test_api.py index 51d2fe606..5752b2798 100644 --- a/tests/core/views/test_api.py +++ b/tests/core/views/test_api.py @@ -274,4 +274,4 @@ async def test_pay_real_invoice( invoice["payment_hash"], inkey_headers_from["X-Api-Key"] ) assert type(response) == dict - assert response["paid"] == True + assert response["paid"] is True diff --git a/tests/helpers.py b/tests/helpers.py index 7aceabc80..5ecbb17e7 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -45,7 +45,7 @@ is_regtest: bool = not is_fake docker_bitcoin_rpc = "lnbits" docker_prefix = "lnbits-legend" -docker_cmd = f"docker exec" +docker_cmd = "docker exec" docker_lightning = f"{docker_cmd} {docker_prefix}-clightning-2-1" docker_lightning_cli = f"{docker_lightning} lightning-cli --network regtest" diff --git a/build.py b/tools/build.py similarity index 97% rename from build.py rename to tools/build.py index 834067c9e..76b85b9cc 100644 --- a/build.py +++ b/tools/build.py @@ -1,9 +1,10 @@ import glob import os import warnings +from pathlib import Path from typing import List -LNBITS_PATH = os.path.dirname(os.path.realpath(__file__)) + "/lnbits" +LNBITS_PATH = Path("lnbits").absolute() def get_js_vendored(prefer_minified: bool = False) -> List[str]: