Open
Conversation
d285107 to
540f9e8
Compare
- Auto-format with black, ruff --fix, prettier - Fix ruff C901: extract _notify_payment_sent helper to reduce complexity - Fix ruff RUF059: prefix unused unpacked variable with underscore - Add noqa: E402 for intentional late imports in standalone test mocks - Fix pyright: add None guard on payment_status.success - Fix mock parameter names to match send_notification signature
Standalone notification tests use heavy sys.modules patching to run without lnbits installed. Exclude them from mypy/pyright since static type checking cannot follow dynamic module injection. Also add type ignore for optional lnurlp extension import.
Standalone test files with sys.modules mocking cause mypy "found twice" errors when in the main package tree. Moving to tests/standalone/ (no __init__.py) prevents mypy from discovering them as package modules. Also update pyright exclude and fix PROJECT_DIR paths.
- Re-run black/ruff/prettier after rebase - Move standalone tests to tests/standalone/ (no __init__.py) to prevent mypy "found twice" module discovery conflict - Exclude tests/standalone/ from mypy and pyright - Fix PROJECT_DIR paths for new location
1324bd0 to
c333590
Compare
Our lock had mypy 1.19.1 which crashes on pydantic v1 env_settings. Main uses mypy 1.17.1 which works correctly.
Adding pyrightconfig.json changed pyright's project resolution, causing it to scan node_modules typeshed stubs. Without the config file, pyright uses the lnbits shared CI workflow defaults which work.
These files use heavy sys.modules patching that pyright cannot follow. Inline directives suppress the expected errors without needing a pyrightconfig.json (which changes pyright's project resolution).
The pairing URL now encodes the relay with quote(), but the test NWCWallet client was using the encoded value directly to connect, causing 'scheme isn't ws or wss' errors.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for it.
Its the part of nwc service provider extension.
nwc funding source needs it in addition to support the spec as well and reduce potential load on server. Requested here:
lnbits/lnbits#3187