Ejemplo n.º 1
0
def test_previous_assets():
    # hack for failure of OSX on github actions
    env = "GITHUB_ACTIONS"
    # os.environ[env] = "true"
    allow_failure = False
    if env in os.environ:
        if sys.platform.lower() == "darwin":
            if os.environ.get(env) == "true":
                allow_failure = True

    mfexes_repo_name = "MODFLOW-USGS/modflow6"
    version = "6.1.0"
    assets = pymake.get_repo_assets(mfexes_repo_name,
                                    version=version,
                                    error_return=True)
    msg = "failed to get release {} ".format(
        version) + "from the '{}' repo".format(mfexes_repo_name)
    if allow_failure:
        if not isinstance(assets, dict):
            print(msg)
        else:
            print("available assets: {}".format(", ".join(assets.keys())))
    else:
        assert isinstance(assets, dict), msg
        print("available assets: {}".format(", ".join(assets.keys())))
Ejemplo n.º 2
0
def test_previous_assets():
    mfexes_repo_name = 'MODFLOW-USGS/modflow6'
    version = '6.0.4'
    assets = pymake.get_repo_assets(mfexes_repo_name, version=version)
    msg = "failed to get release {} ".format(version) + \
          "from the '{}' repo".format(mfexes_repo_name)
    assert isinstance(assets, dict), msg
    return
Ejemplo n.º 3
0
def test_latest_assets():
    mfexes_repo_name = 'MODFLOW-USGS/executables'
    assets = pymake.get_repo_assets(mfexes_repo_name)
    keys = assets.keys()
    test_keys = ['mac.zip', 'linux.zip', 'win32.zip', 'win64.zip']
    for key in keys:
        msg = 'unknown key ({}) found in github repo assets'.format(key)
        assert key in test_keys, msg
    return
Ejemplo n.º 4
0
def test_latest_assets():
    mfexes_repo_name = "MODFLOW-USGS/executables"
    assets = pymake.get_repo_assets(mfexes_repo_name)
    keys = assets.keys()
    test_keys = ["mac.zip", "linux.zip", "win32.zip", "win64.zip"]
    for key in keys:
        print("evaluating the availability of...{}".format(key))
        msg = "unknown key ({}) found in github repo assets".format(key)
        assert key in test_keys, msg
    return
Ejemplo n.º 5
0
import numpy as np
import matplotlib as mpl
import flopy
import pymake

# Print python package versions
flopypth = flopy.__path__[0]
pymakepth = pymake.__path__[0]
print("python version:     {}".format(sys.version))
print("numpy version:      {}".format(np.__version__))
print("matplotlib version: {}".format(mpl.__version__))
print("flopy version:      {}".format(flopy.__version__))
print("pymake version:     {}".format(pymake.__version__))
print("")
print("flopy is installed in:  {}".format(flopypth))
print("pymake is installed in: {}".format(pymakepth))

# Update flopy from GitHub repo
flopy.mf6.utils.generate_classes(branch="develop", backup=False)

# Get executables
bin_pth = os.path.join("..", "bin")
if not os.path.isdir(bin_pth):
    os.makedirs(bin_pth)
pymake.getmfexes(bin_pth, verbose=True)

# Replace MODFLOW 6 executables with the latest versions
url = pymake.get_repo_assets(
    "MODFLOW-USGS/modflow6-nightly-build")["linux.zip"]
pymake.download_and_unzip(url, bin_pth, verbose=True)