Пример #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
Пример #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
Пример #3
0
    def update(self):
        """
        Performs pip upgrade
        """
        # Notify update successful
        sickrage.srCore.srLogger.info("Updating SiCKRAGE from PyPi servers")
        srNotifiers.notify_version_update(sickrage.srCore.NEWEST_VERSION_STRING)

        from pip.commands.install import InstallCommand
        options = InstallCommand().parse_args([])[0]
        options.use_user_site = all([not sickrage.isElevatedUser(), not sickrage.isVirtualEnv()])
        options.cache_dir = None
        options.upgrade = True
        options.quiet = 1

        options.ignore_dependencies = True
        InstallCommand().run(options, ['sickrage'])
        options.ignore_dependencies = False
        InstallCommand().run(options, ['sickrage'])

        return True
Пример #4
0
    def update(self):
        """
        Performs pip upgrade
        """
        # Notify update successful
        sickrage.srCore.srLogger.info("Updating SiCKRAGE from PyPi servers")
        srNotifiers.notify_version_update(sickrage.srCore.NEWEST_VERSION_STRING)

        from pip.commands.install import InstallCommand
        options = InstallCommand().parse_args([])[0]
        options.use_user_site = all([not sickrage.isElevatedUser(), not sickrage.isVirtualEnv()])
        options.cache_dir = None
        options.upgrade = True
        options.quiet = 1

        options.ignore_dependencies = True
        InstallCommand().run(options, ['sickrage'])
        options.ignore_dependencies = False
        InstallCommand().run(options, ['sickrage'])

        return True