Beispiel #1
0
def install_requirements():
    from pip.commands.install import InstallCommand
    from pkg_resources import ContextualVersionConflict

    requirements = [
        os.path.abspath(
            os.path.join(os.path.dirname(__file__), 'requirements.txt'))
    ]
    options = InstallCommand().parse_args([])[0]
    options.use_user_site = root_check() and not virtualenv_check()
    options.requirements = requirements
    options.cache_dir = None
    options.upgrade = True
    options.quiet = 1
    options.pre = True

    # install/upgrade all requirements for sickrage
    print("Installing SiCKRAGE requirement packages, please stand by ...")

    attempts = 0
    while attempts < 3:
        try:
            options.ignore_dependencies = True
            InstallCommand().run(options, [])
            options.ignore_dependencies = False
            InstallCommand().run(options, [])
        except ContextualVersionConflict:
            attempts += 1
            time.sleep(1)
        finally:
            break
Beispiel #2
0
def install_requirements():
    from pip.commands.install import InstallCommand
    from pkg_resources import ContextualVersionConflict

    requirements = [os.path.abspath(os.path.join(os.path.dirname(__file__), 'requirements.txt'))]
    options = InstallCommand().parse_args([])[0]
    options.use_user_site = root_check() and not virtualenv_check()
    options.requirements = requirements
    options.cache_dir = None
    options.upgrade = True
    options.quiet = 1
    options.pre = True

    # install/upgrade all requirements for sickrage
    print("Installing SiCKRAGE requirement packages, please stand by ...")

    attempts = 0
    while attempts < 3:
        try:
            options.ignore_dependencies = True
            InstallCommand().run(options, [])
            options.ignore_dependencies = False
            InstallCommand().run(options, [])
        except ContextualVersionConflict:
            attempts += 1
            time.sleep(1)
        finally:
            break