-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not require indy or bbs to be installed
Signed-off-by: Timo Glastra <[email protected]>
- Loading branch information
1 parent
cd4e4b0
commit 8259840
Showing
14 changed files
with
152 additions
and
58 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
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
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,51 @@ | ||
"""Dependency related util methods.""" | ||
|
||
import sys | ||
|
||
|
||
def is_indy_sdk_module_installed(): | ||
"""Check whether indy (indy-sdk) module is installed. | ||
Returns: | ||
bool: Whether indy (indy-sdk) is installed. | ||
""" | ||
try: | ||
# Check if already imported | ||
if "indy" in sys.modules: | ||
return True | ||
|
||
# Try to import | ||
import indy # noqa: F401 | ||
|
||
return True | ||
except ModuleNotFoundError: | ||
# Not installed if import went wrong | ||
return False | ||
|
||
|
||
def is_ursa_bbs_signatures_module_installed(): | ||
"""Check whether ursa_bbs_signatures module is installed. | ||
Returns: | ||
bool: Whether ursa_bbs_signatures is installed. | ||
""" | ||
try: | ||
# Check if already imported | ||
if "ursa_bbs_signatures" in sys.modules: | ||
return True | ||
|
||
# Try to import | ||
import ursa_bbs_signatures # noqa: F401 | ||
|
||
return True | ||
except ModuleNotFoundError: | ||
# Not installed if import went wrong | ||
return False | ||
|
||
|
||
def assert_ursa_bbs_signatures_installed(): | ||
"""Assert ursa_bbs_signatures module is installed.""" | ||
if not is_ursa_bbs_signatures_module_installed(): | ||
raise Exception("ursa_bbs_signatures module not installed") |
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
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
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
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
Oops, something went wrong.