Skip to content

fix: import issues#332

Merged
k9ert merged 1 commit intocryptoadvance:masterfrom
k9ert:kn/fix_native_tests
Dec 4, 2025
Merged

fix: import issues#332
k9ert merged 1 commit intocryptoadvance:masterfrom
k9ert:kn/fix_native_tests

Conversation

@k9ert
Copy link
Contributor

@k9ert k9ert commented Nov 28, 2025

fixes #331

(.env) ➜  specter-diy.old git:(master) ✗ python3 test/run_native_tests.py
Traceback (most recent call last):
  File "/Users/kim/src/specter-diy.old/test/run_native_tests.py", line 13, in <module>
    setup_native_stubs()
  File "/Users/kim/src/specter-diy.old/test/native_support.py", line 191, in setup_native_stubs
    from apps.wallets.wallet import Wallet as _Wallet
  File "/Users/kim/src/specter-diy.old/src/apps/wallets/__init__.py", line 1, in <module>
    from .app import WalletsApp as App
  File "/Users/kim/src/specter-diy.old/src/apps/wallets/app.py", line 3, in <module>
    from .manager import WalletManager
  File "/Users/kim/src/specter-diy.old/src/apps/wallets/manager.py", line 8, in <module>
    from embit import script, bip32, compact
  File "/Users/kim/src/specter-diy.old/f469-disco/libs/common/embit/script.py", line 1, in <module>
    from .networks import NETWORKS
  File "/Users/kim/src/specter-diy.old/f469-disco/libs/common/embit/networks.py", line 1, in <module>
    from .misc import const
  File "/Users/kim/src/specter-diy.old/f469-disco/libs/common/embit/misc.py", line 9, in <module>
    from .util import secp256k1
ModuleNotFoundError: No module named 'embit.util'

@netlify
Copy link

netlify bot commented Nov 28, 2025

Deploy Preview for specter-diy-docs ready!

Name Link
🔨 Latest commit e78e588
🔍 Latest deploy log https://app.netlify.com/projects/specter-diy-docs/deploys/692993182c867d00085a580b
😎 Deploy Preview https://deploy-preview-332--specter-diy-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

from apps.wallets.wallet import Wallet as _Wallet
except ModuleNotFoundError as exc:
if exc.name == "embit":
if exc.name.startswith("embit"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how the naming convention works, but it would be more standard to check:

if exc.name == "embit" or exc.name.startswith("embit."):

In case someone releases a package named "embit_something".

@tadeubas
Copy link
Collaborator

tadeubas commented Dec 3, 2025

The PR seems to be just related to test changes, and to me solved the issue, I think this can be merged.

CMD: python3 test/run_native_tests.py:

After PR:

/home/Documents/projects/specter-diy/src/keystore/flash.py:287: SyntaxWarning: "is" with 'str' literal. Did you mean "=="?
  if displayname is "":
test_descriptor_without_addwallet_prefix_is_parsed (tests_native.test_wallet_manager_parsing.WalletManagerParsingTest.test_descriptor_without_addwallet_prefix_is_parsed) ... ok
test_docs_address_request_is_detected (tests_native.test_wallet_manager_parsing.WalletManagerParsingTest.test_docs_address_request_is_detected) ... ok
test_docs_addwallet_command_is_detected (tests_native.test_wallet_manager_parsing.WalletManagerParsingTest.test_docs_addwallet_command_is_detected) ... ok
test_docs_base64_psbt_is_detected (tests_native.test_wallet_manager_parsing.WalletManagerParsingTest.test_docs_base64_psbt_is_detected) ... ok
test_raw_descriptor_is_parsed (tests_native.test_wallet_manager_parsing.WalletManagerParsingTest.test_raw_descriptor_is_parsed) ... ok

----------------------------------------------------------------------
Ran 5 tests in 0.094s

OK

Before PR:

Traceback (most recent call last):
  File "/home/Documents/projects/specter-diy/test/run_native_tests.py", line 13, in <module>
    setup_native_stubs()
    ~~~~~~~~~~~~~~~~~~^^
  File "/home/Documents/projects/specter-diy/test/native_support.py", line 191, in setup_native_stubs
    from apps.wallets.wallet import Wallet as _Wallet
  File "/home/Documents/projects/specter-diy/src/apps/wallets/__init__.py", line 1, in <module>
    from .app import WalletsApp as App
  File "/home/Documents/projects/specter-diy/src/apps/wallets/app.py", line 3, in <module>
    from .manager import WalletManager
  File "/home/Documents/projects/specter-diy/src/apps/wallets/manager.py", line 8, in <module>
    from embit import script, bip32, compact
  File "/home/Documents/projects/specter-diy/f469-disco/libs/common/embit/script.py", line 1, in <module>
    from .networks import NETWORKS
  File "/home/Documents/projects/specter-diy/f469-disco/libs/common/embit/networks.py", line 1, in <module>
    from .misc import const
  File "/home/Documents/projects/specter-diy/f469-disco/libs/common/embit/misc.py", line 9, in <module>
    from .util import secp256k1
ModuleNotFoundError: No module named 'embit.util'

@k9ert k9ert merged commit 5bc685c into cryptoadvance:master Dec 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

native tests don't work locally

3 participants