[cli] Add libs check for linux & update version

pull/2/head
Daniel Van Der Maden 5 years ago
parent 2bac075d73
commit 025351527f
  1. 2
      pyhmy/_version.py
  2. 7
      pyhmy/cli.py

@ -7,5 +7,5 @@ Provides pyhmy version information.
from incremental import Version from incremental import Version
__version__ = Version('pyhmy', 20, 1, 2) __version__ = Version('pyhmy', 20, 1, 3)
__all__ = ["__version__"] __all__ = ["__version__"]

@ -57,7 +57,10 @@ import requests
from .util import get_bls_build_variables, get_gopath from .util import get_bls_build_variables, get_gopath
_dylibs = {"libbls384_256.dylib", "libcrypto.1.0.0.dylib", "libgmp.10.dylib", "libgmpxx.4.dylib", "libmcl.dylib"} if sys.platform.startswith("linux"):
_libs = {"libbls384_256.so", "libcrypto.so.10", "libgmp.so.10", "libgmpxx.so.4", "libmcl.so"}
else:
_libs = {"libbls384_256.dylib", "libcrypto.1.0.0.dylib", "libgmp.10.dylib", "libgmpxx.4.dylib", "libmcl.dylib"}
_accounts = {} # Internal accounts keystore, make sure to sync when needed. _accounts = {} # Internal accounts keystore, make sure to sync when needed.
_account_keystore_path = "~/.hmy/account-keys" # Internal path to account keystore, will match the current binary. _account_keystore_path = "~/.hmy/account-keys" # Internal path to account keystore, will match the current binary.
_binary_path = "hmy" # Internal binary path. _binary_path = "hmy" # Internal binary path.
@ -351,7 +354,7 @@ def download(path="./bin/hmy", replace=True, verbose=True):
env = os.environ.copy() env = os.environ.copy()
files_in_parent_dir = set(os.listdir(parent_dir)) files_in_parent_dir = set(os.listdir(parent_dir))
if files_in_parent_dir.intersection(_dylibs) == _dylibs: if files_in_parent_dir.intersection(_libs) == _libs:
if sys.platform.startswith("linux"): if sys.platform.startswith("linux"):
env["LD_LIBRARY_PATH"] = parent_dir env["LD_LIBRARY_PATH"] = parent_dir
else: else:

Loading…
Cancel
Save