Esempio n. 1
0
def install(package):
    if hasattr(pip, 'main'):
        pip.main(['install', package])
    else:
        from pip._internal.main import main as pipmain
        pipmain(['install', package])
Esempio n. 2
0
import pip
import sys
import warnings

from distutils.version import LooseVersion

pipversion = LooseVersion(pip.__version__ )

if pipversion >= LooseVersion("19.3"):
    from pip._internal import pep425tags
    from pip._internal.main import main as pipmain
elif pipversion > LooseVersion("10"):
    from pip._internal import pep425tags
    from pip._internal import main as pipmain
else:
    if pipversion < LooseVersion("8.1.2"):
        warnings.warn("Pip version less than 8.1.2 not supported.", Warning)
    from pip import pep425tags
    from pip import main as pipmain

# Monkey patch the pip version information with server information
pep425tags.is_manylinux2010_compatible = lambda: True
pep425tags.is_manylinux1_compatible = lambda: True
pep425tags.get_impl_version_info = lambda: eval(sys.argv[1])
pep425tags.get_abbr_impl = lambda: sys.argv[2]
pep425tags.get_abi_tag = lambda: sys.argv[3]
pep425tags.get_platform = lambda: sys.argv[4]

# Call pipmain with the download request
pipmain(list(map(str.strip, sys.argv[5].split(","))))
Esempio n. 3
0
        'scipy>=1.1.0',
    ])

    # use `audioread` as the default backend
    from looper.config import LooperConfig, DEFAULT_CONFIG_FILE
    config = LooperConfig.load()
    config.update(backend='audioread')
    config.save()

    IS_FFMPEG_REQUIRED = True
    IS_CONFIG_REQUIRED = True
else:
    # install `mpg123` as the default backend
    requirements.append('mpg123==0.4')

pipmain(['install'] + requirements)

metadata = dict(
    name='Looper',
    version=VERSION,
    author='NolanNicholson',
    license='MIT',
    description=
    'A script for repeating music seamlessly and endlessly, designed with video game music in mind.',
    url='https://github.com/NolanNicholson/Looper',
    packages=packages,
    include_package_data=IS_CONFIG_REQUIRED,
    package_data={'': ['*.json']} if IS_CONFIG_REQUIRED else {},
    cmdclass={
        'install': PostInstallCommand,
    })