parent
a001cdc7f5
commit
656ce51249
@ -1,14 +1,35 @@ |
|||||||
# |
import sys |
||||||
# This package relies on the fact that there is a CLI binary from some path |
import warnings |
||||||
# starting at the root of the file script importing this package. |
import pkg_resources |
||||||
# This package requires the pexpect package: https://pypi.org/project/pexpect/ . |
|
||||||
# |
from .cli import ( |
||||||
|
HmyCLI, |
||||||
from pyhmy.cli import HmyCLI, get_environment |
get_environment, |
||||||
import os |
) |
||||||
|
|
||||||
# Find the CLI binary for HmyCLI. |
from .util import ( |
||||||
for root, dirs, files in os.walk(os.path.curdir): |
Typgpy, |
||||||
if "hmy" in files: |
get_gopath, |
||||||
HmyCLI.hmy_binary_path = os.path.join(root, "hmy") |
get_goversion, |
||||||
break |
json_load |
||||||
|
) |
||||||
|
|
||||||
|
if sys.version_info.major < 3: |
||||||
|
warnings.simplefilter("always", DeprecationWarning) |
||||||
|
warnings.warn( |
||||||
|
DeprecationWarning( |
||||||
|
"`pyhmy` does not support Python 2. Please use Python 3." |
||||||
|
) |
||||||
|
) |
||||||
|
warnings.resetwarnings() |
||||||
|
|
||||||
|
if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): |
||||||
|
warnings.simplefilter("always", ImportWarning) |
||||||
|
warnings.warn( |
||||||
|
ImportWarning( |
||||||
|
"`pyhmy` does not work on Windows or Cygwin." |
||||||
|
) |
||||||
|
) |
||||||
|
warnings.resetwarnings() |
||||||
|
|
||||||
|
__version__ = pkg_resources.get_distribution("pyhmy").version |
||||||
|
Loading…
Reference in new issue