Poetry dev (#837)

* black and isort for tests

* black and isort for build

* use poetry in Makefile, update pyproject.toml dependencies and add configs for black, pytest, mypy, isort there

* switching github workflow to poetry

* set mininum version to python 3.7

* fix tests

* add types-protobuf to dev packages

* fix cln regtest

* update docs

* try fix 1

* mypy fix2

* fix isort formatting workflow

* add prettier to dev docs

* multiple valid python version for pyproject

* update poetry.lock

* remove development installation, not needed anymore

* fix migration workflows

* format into one test

* fix yaml

* fix pipeline

* fix pipeline

* fix again

* fix

* rename checks

* remove venv tests

* venv test once

Co-authored-by: dni <dni.khr@gmail.com>
This commit is contained in:
calle 2022-08-03 14:10:32 +02:00 committed by GitHub
parent 2edaa0ee03
commit 8535d70d36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 689 additions and 286 deletions

View file

@ -1,19 +1,17 @@
import asyncio
import pytest_asyncio
from typing import Tuple
import pytest_asyncio
from httpx import AsyncClient
from lnbits.app import create_app
from lnbits.commands import migrate_databases
from lnbits.settings import HOST, PORT
from lnbits.core.views.api import api_payments_create_invoice, CreateInvoiceData
from lnbits.core.crud import create_account, create_wallet, get_wallet
from tests.helpers import credit_wallet, get_random_invoice_data
from lnbits.core.models import BalanceCheck, Payment, User, Wallet
from lnbits.core.views.api import CreateInvoiceData, api_payments_create_invoice
from lnbits.db import Database
from lnbits.core.models import User, Wallet, Payment, BalanceCheck
from typing import Tuple
from lnbits.settings import HOST, PORT
from tests.helpers import credit_wallet, get_random_invoice_data
@pytest_asyncio.fixture(scope="session")

View file

@ -1,17 +1,20 @@
import pytest
import pytest_asyncio
import hashlib
from binascii import hexlify
import pytest
import pytest_asyncio
from lnbits import bolt11
from lnbits.core.crud import get_wallet
from lnbits.core.views.api import api_payment
from lnbits.core.views.api import api_payments_create_invoice, CreateInvoiceData
from lnbits.core.views.api import (
CreateInvoiceData,
api_payment,
api_payments_create_invoice,
)
from ...helpers import get_random_invoice_data
# check if the client is working
@pytest.mark.asyncio
async def test_core_views_generic(client):

View file

@ -1,5 +1,6 @@
import pytest
import pytest_asyncio
from tests.conftest import client

View file

@ -1,7 +1,9 @@
import pytest
import pytest_asyncio
from lnbits.core.crud import get_wallet
# check if the client is working
@pytest.mark.asyncio
async def test_core_views_generic(client):

View file

@ -1,17 +1,19 @@
import json
import secrets
import pytest
import pytest_asyncio
import secrets
from lnbits.core.crud import create_account, create_wallet
from lnbits.extensions.bleskomat.crud import create_bleskomat, create_bleskomat_lnurl
from lnbits.extensions.bleskomat.models import CreateBleskomat
from lnbits.extensions.bleskomat.exchange_rates import exchange_rate_providers
from lnbits.extensions.bleskomat.helpers import (
generate_bleskomat_lnurl_secret,
generate_bleskomat_lnurl_signature,
prepare_lnurl_params,
query_to_signing_payload,
)
from lnbits.extensions.bleskomat.exchange_rates import exchange_rate_providers
from lnbits.extensions.bleskomat.models import CreateBleskomat
exchange_rate_providers["dummy"] = {
"name": "dummy",

View file

@ -1,16 +1,18 @@
import secrets
import pytest
import pytest_asyncio
import secrets
from lnbits.core.crud import get_wallet
from lnbits.settings import HOST, PORT
from lnbits.extensions.bleskomat.crud import get_bleskomat_lnurl
from lnbits.extensions.bleskomat.helpers import (
generate_bleskomat_lnurl_signature,
query_to_signing_payload,
)
from lnbits.settings import HOST, PORT
from tests.conftest import client
from tests.helpers import credit_wallet
from tests.extensions.bleskomat.conftest import bleskomat, lnurl
from tests.helpers import credit_wallet
from tests.mocks import WALLET

View file

@ -1,7 +1,8 @@
import hashlib
import secrets
import random
import secrets
import string
from lnbits.core.crud import create_payment

View file

@ -1,12 +1,8 @@
from mock import AsyncMock
from lnbits import bolt11
from lnbits.wallets.base import (
StatusResponse,
PaymentResponse,
PaymentStatus,
)
from lnbits.settings import WALLET
from lnbits import bolt11
from lnbits.settings import WALLET
from lnbits.wallets.base import PaymentResponse, PaymentStatus, StatusResponse
from lnbits.wallets.fake import FakeWallet
from .helpers import get_random_string