-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes yo make black add ci add pytestmd
- Loading branch information
Showing
25 changed files
with
3,183 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
uses: lnbits/lnbits/.github/workflows/lint.yml@dev | ||
tests: | ||
runs-on: ubuntu-latest | ||
needs: [lint] | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: lnbits/lnbits/.github/actions/prepare@dev | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run pytest | ||
uses: pavelzw/pytest-action@v2 | ||
env: | ||
LNBITS_BACKEND_WALLET_CLASS: FakeWallet | ||
PYTHONUNBUFFERED: 1 | ||
DEBUG: true | ||
with: | ||
verbose: true | ||
job-summary: true | ||
emoji: false | ||
click-to-expand: true | ||
custom-pytest: poetry run pytest | ||
report-title: 'test (${{ matrix.python-version }})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
__pycache__ | ||
__pycache__ | ||
node_modules | ||
.mypy_cache | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"semi": false, | ||
"arrowParens": "avoid", | ||
"insertPragma": false, | ||
"printWidth": 80, | ||
"proseWrap": "preserve", | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"useTabs": false, | ||
"bracketSameLine": false, | ||
"bracketSpacing": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
all: format check | ||
|
||
format: prettier black ruff | ||
|
||
check: mypy pyright checkblack checkruff checkprettier | ||
|
||
prettier: | ||
poetry run ./node_modules/.bin/prettier --write . | ||
pyright: | ||
poetry run ./node_modules/.bin/pyright | ||
|
||
mypy: | ||
poetry run mypy . | ||
|
||
black: | ||
poetry run black . | ||
|
||
ruff: | ||
poetry run ruff check . --fix | ||
|
||
checkruff: | ||
poetry run ruff check . | ||
|
||
checkprettier: | ||
poetry run ./node_modules/.bin/prettier --check . | ||
|
||
checkblack: | ||
poetry run black --check . | ||
|
||
checkeditorconfig: | ||
editorconfig-checker | ||
|
||
test: | ||
PYTHONUNBUFFERED=1 \ | ||
DEBUG=true \ | ||
poetry run pytest | ||
install-pre-commit-hook: | ||
@echo "Installing pre-commit hook to git" | ||
@echo "Uninstall the hook with poetry run pre-commit uninstall" | ||
poetry run pre-commit install | ||
|
||
pre-commit: | ||
poetry run pre-commit run --all-files | ||
|
||
|
||
checkbundle: | ||
@echo "skipping checkbundle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
uses: lnbits/lnbits/.github/workflows/lint.yml@dev | ||
tests: | ||
runs-on: ubuntu-latest | ||
needs: [lint] | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: lnbits/lnbits/.github/actions/prepare@dev | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run pytest | ||
uses: pavelzw/pytest-action@v2 | ||
env: | ||
LNBITS_BACKEND_WALLET_CLASS: FakeWallet | ||
PYTHONUNBUFFERED: 1 | ||
DEBUG: true | ||
with: | ||
verbose: true | ||
job-summary: true | ||
emoji: false | ||
click-to-expand: true | ||
custom-pytest: poetry run pytest | ||
report-title: 'test (${{ matrix.python-version }})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
Make payment QR codes that people can pay some sats to an receive a random word from a list. | ||
|
||
Example use cases: | ||
* Magic 8 Ball | ||
* Pay for satoshi quotes | ||
|
||
As seen in the "1hr extension build tutorial" https://www.youtube.com/watch?v=zHXLvvjClHI | ||
- Magic 8 Ball | ||
- Pay for satoshi quotes | ||
|
||
As seen in the "1hr extension build tutorial" https://www.youtube.com/watch?v=zHXLvvjClHI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
from sqlite3 import Row | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class CreateEightBallData(BaseModel): | ||
wallet: Optional[str] | ||
name: Optional[str] | ||
wordlist: Optional[str] | ||
lnurlpayamount: Optional[int] | ||
name: str | ||
wordlist: str | ||
lnurlpayamount: int | ||
wallet: Optional[str] = None | ||
|
||
|
||
class EightBall(BaseModel): | ||
id: str | ||
wallet: Optional[str] | ||
name: Optional[str] | ||
wordlist: Optional[str] | ||
lnurlpayamount: Optional[int] | ||
wallet: str | ||
name: str | ||
wordlist: str | ||
lnurlpayamount: int | ||
lnurlpay: Optional[str] | ||
|
||
@classmethod | ||
def from_row(cls, row: Row) -> "EightBall": | ||
return cls(**dict(row)) |
Oops, something went wrong.