Exemplo n.º 1
0
def do_main(temp_folder="build/update_modules",
            skip_module="ete dataspyre pycuda cubehelix".split(),
            list_module=None,
            schedule_only=False,
            source=None):
    """
    calls function @see fn update_all but is meant to be added to scripts folder

    @param      temp_folder     folder where modules will be downloaded
    @param      skip_module     skip the module on this list
    @param      list_module     list of modules to update or None for all
    @param      schedule_only   if True, the function returns the list of modules scheduled to be installed
    @param      source          overwrite the source of the wheels
    """
    try:
        from pymyinstall import is_travis_or_appveyor
    except ImportError:

        def is_travis_or_appveyor():
            import sys
            if "travis" in sys.executable:
                return "travis"
            import os
            if os.environ.get("USERNAME", os.environ.get("USER",
                                                         None)) == "appveyor":
                return "appveyor"
            return None

    if is_travis_or_appveyor() and source is None:
        source = "2"

    if not os.path.exists(temp_folder):
        os.makedirs(temp_folder)
    try:
        from pymyinstall.packaged import update_all
    except ImportError:
        pfolder = os.path.normpath(
            os.path.join(os.path.abspath(os.path.dirname(__file__)), "..",
                         ".."))
        sys.path.append(pfolder)
        if "pymyinstall" in sys.modules:
            del sys.modules["pymyinstall"]
        if "pymyinstall.packaged" in sys.modules:
            del sys.modules["pymyinstall.packaged"]
        from pymyinstall.packaged import update_all
    res = update_all(temp_folder=temp_folder,
                     verbose=True,
                     skip_module=skip_module,
                     list_module=list_module,
                     schedule_only=schedule_only,
                     source=source)
    if schedule_only:
        print("SCHEDULED")
        for r in res:
            print(r)
Exemplo n.º 2
0
def do_main(temp_folder="build/update_modules",
            skip_module=["ete", "dataspyre", "pycuda", "cubehelix"],
            list_module=None, schedule_only=False, source=None):
    """
    calls function @see fn update_all but is meant to be added to scripts folder

    @param      temp_folder     folder where modules will be downloaded
    @param      skip_module     skip the module on this list
    @param      list_module     list of modules to update or None for all
    @param      schedule_only   if True, the function returns the list of modules scheduled to be installed
    @param      source          overwrite the source of the wheels
    """
    try:
        from pymyinstall import is_travis_or_appveyor
    except ImportError:
        def is_travis_or_appveyor():
            import sys
            if "travis" in sys.executable:
                return "travis"
            import os
            if os.environ.get("USERNAME", os.environ.get("USER", None)) == "appveyor":
                return "appveyor"
            return None
    if is_travis_or_appveyor() and source is None:
        source = "2"

    if not os.path.exists(temp_folder):
        os.makedirs(temp_folder)
    try:
        from pymyinstall.packaged import update_all
    except ImportError:
        pfolder = os.path.normpath(os.path.join(
            os.path.abspath(os.path.dirname(__file__)), "..", ".."))
        sys.path.append(pfolder)
        if "pymyinstall" in sys.modules:
            del sys.modules["pymyinstall"]
        if "pymyinstall.packaged" in sys.modules:
            del sys.modules["pymyinstall.packaged"]
        from pymyinstall.packaged import update_all
    res = update_all(temp_folder=temp_folder, verbose=True,
                     skip_module=skip_module, list_module=list_module,
                     schedule_only=schedule_only, source=source)
    if schedule_only:
        print("SCHEDULED")
        for r in res:
            print(r)
Exemplo n.º 3
0
import sys

sys.path.append("../src")
from pymyinstall.packaged import update_all

update_all(temp_folder="build/update_modules",
           verbose=True,
           skip_module=[],
           source="2")