Ejemplo n.º 1
0
def parse_reqs(reqs_file):
    ''' parse the requirements '''
    options = Option("--workaround")
    options.skip_requirements_regex = None
    options.isolated_mode = True
    install_reqs = parse_requirements(reqs_file, options=options, session=PipSession())
    return [str(ir.req) for ir in install_reqs]
Ejemplo n.º 2
0
def parse_reqs(reqs_file):
    ''' parse the requirements '''
    options = Option("--workaround")
    options.skip_requirements_regex = None
    # Hack for old pip versions
    if pip.__version__.startswith('10.'):
        # Versions greater or equal to 10.x don't rely on pip.req.parse_requirements
        install_reqs = list(val.strip() for val in open(reqs_file))
        reqs = install_reqs
    elif pip.__version__.startswith('1.'):
        # Versions 1.x rely on pip.req.parse_requirements
        # but don't require a "session" parameter
        from pip.req import parse_requirements # pylint:disable=no-name-in-module, import-error
        install_reqs = parse_requirements(reqs_file, options=options)
        reqs = [str(ir.req) for ir in install_reqs]
    else:
        # Versions greater than 1.x but smaller than 10.x rely on pip.req.parse_requirements
        # and requires a "session" parameter
        from pip.req import parse_requirements # pylint:disable=no-name-in-module, import-error
        from pip.download import PipSession  # pylint:disable=no-name-in-module, import-error
        options.isolated_mode = False
        install_reqs = parse_requirements(  # pylint:disable=unexpected-keyword-arg
            reqs_file,
            session=PipSession,
            options=options
        )
        reqs = [str(ir.req) for ir in install_reqs]
    return reqs
Ejemplo n.º 3
0
def parse_reqs(reqs_file):
    """ parse the requirements """
    options = Option("--workaround")
    options.skip_requirements_regex = None
    # Hack for old pip versions: Versions greater than 1.x
    # have a required parameter "sessions" in parse_requierements
    if pip.__version__.startswith("1."):
        install_reqs = parse_requirements(reqs_file, options=options)
    else:
        from pip.download import PipSession  # pylint:disable=E0611

        options.isolated_mode = False
        install_reqs = parse_requirements(reqs_file, options=options, session=PipSession)  # pylint:disable=E1123
    return [str(ir.req) for ir in install_reqs]
Ejemplo n.º 4
0
def parse_reqs(reqs_file):
    ''' parse the requirements '''
    options = Option('--workaround')
    options.skip_requirements_regex = None
    # Hack for old pip versions: Versions greater than 1.x
    # have a required parameter "sessions" in parse_requierements
    if pip.__version__.startswith('1.'):
        install_reqs = parse_requirements(reqs_file, options=options)
    else:
        from pip.download import PipSession  # pylint:disable=E0611
        options.isolated_mode = False
        install_reqs = parse_requirements(
            reqs_file,  # pylint:disable=E1123
            options=options,
            session=PipSession)
    return [str(ir.req) for ir in install_reqs]
Ejemplo n.º 5
0
def parse_reqs(reqs_file):
    ''' parse the requirements '''
    options = Option('--workaround')
    options.skip_requirements_regex = None
    # Hack for old pip versions
    # Versions greater than 1.x have a required parameter "session" in
    # parse_requirements
    if pip.__version__.startswith('1.'):
        install_reqs = parse_requirements(reqs_file, options=options)
    else:
        from pip.download import PipSession  # pylint:disable=no-name-in-module
        options.isolated_mode = False
        install_reqs = parse_requirements(  # pylint:disable=unexpected-keyword-arg
            reqs_file,
            session=PipSession,
            options=options)
    return [str(ir.req) for ir in install_reqs]
Ejemplo n.º 6
0
'''setup.py'''

from setuptools import setup

import hbp_nrp_backend
import pip

from optparse import Option
options = Option('--workaround')
options.skip_requirements_regex = None
reqs_file = './requirements.txt'
# Hack for old pip versions
if pip.__version__.startswith('10.'):
    # Versions greater or equal to 10.x don't rely on pip.req.parse_requirements
    install_reqs = list(val.strip() for val in open(reqs_file))
    reqs = install_reqs
elif pip.__version__.startswith('1.'):
    # Versions 1.x rely on pip.req.parse_requirements
    # but don't require a "session" parameter
    from pip.req import parse_requirements  # pylint:disable=no-name-in-module, import-error
    install_reqs = parse_requirements(reqs_file, options=options)
    reqs = [str(ir.req) for ir in install_reqs]
else:
    # Versions greater than 1.x but smaller than 10.x rely on pip.req.parse_requirements
    # and require a "session" parameter
    from pip.req import parse_requirements  # pylint:disable=no-name-in-module, import-error
    from pip.download import PipSession  # pylint:disable=no-name-in-module, import-error
    options.isolated_mode = False
    install_reqs = parse_requirements(  # pylint:disable=unexpected-keyword-arg
        reqs_file,
        session=PipSession,
Ejemplo n.º 7
0
def parse_reqs(reqs_file):
    ''' parse the requirements '''
    options = Option("--workaround")
    options.skip_requirements_regex = None
    install_reqs = parse_requirements(reqs_file, options=options)
    return [str(ir.req) for ir in install_reqs]
Ejemplo n.º 8
0
# File created by: Gabriel Urbain <*****@*****.**>
#                  Dimitri Rodarie <*****@*****.**>
# February 2016
##
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup
from optparse import Option

import pip
import src
from pip.req import parse_requirements

options = Option("--workaround")
options.skip_requirements_regex = None

reqs_file = './requirements.txt'

# Hack for old pip versions
# Versions greater than 1.x have a required parameter "session" in parse_requirements
if pip.__version__.startswith('1.'):
    requirements = parse_requirements(reqs_file, options=options)
else:
    from pip.download import PipSession
    options.isolated_mode = False
    requirements = parse_requirements(
        reqs_file,
        session=PipSession,
        options=options
    )
Ejemplo n.º 9
0
import pip
from setuptools import setup
from pip.req import parse_requirements

try:
    import pypandoc
    long_description = pypandoc.convert('../README.md', 'rst')
except (IOError, ImportError):
    long_description = open('../README.md').read()

# This is a hack to work with newer versions of pip
if (pip.__version__.startswith('1.5') or int(pip.__version__[:1]) > 5):
    from pip.download import PipSession  # pylint:disable=E0611
    OPTIONS = Option("--workaround")
    OPTIONS.skip_requirements_regex = None
    OPTIONS.isolated_mode = False
    # pylint:disable=E1123
    INSTALL_REQS = parse_requirements(os.path.join(os.path.dirname(__file__),
                                                   "requirements.txt"),
                                      options=OPTIONS,
                                      session=PipSession)
else:  # this is the production path, running on RHEL
    OPTIONS = Option("--workaround")
    OPTIONS.skip_requirements_regex = None
    INSTALL_REQS = parse_requirements(os.path.join(os.path.dirname(__file__),
                                                   "requirements.txt"),
                                      options=OPTIONS)

reqs = [str(ir.req) for ir in INSTALL_REQS]
Ejemplo n.º 10
0
#!/usr/bin/env python
""" HBP Collaboratory python oauth2 module """
from setuptools import setup
from hbp_app_python_auth.version import VERSION
from pip.req import parse_requirements
from optparse import Option

import pip

#This is a hack to work with newer versions of pip
if pip.__version__.startswith('1.5') or pip.__version__.startswith('6') or pip.__version__.startswith('7') :
    from pip.download import PipSession # pylint:disable=E0611
    OPTIONS = Option("--workaround")
    OPTIONS.skip_requirements_regex = None
    OPTIONS.isolated_mode = False
    INSTALL_REQS = parse_requirements("./requirements.txt", # pylint:disable=E1123
                                      options=OPTIONS,
                                      session=PipSession)
else:  # this is the production path, running on RHEL
    OPTIONS = Option("--workaround")
    OPTIONS.skip_requirements_regex = None
    INSTALL_REQS = parse_requirements("./requirements.txt", options=OPTIONS)


REQS = [str(ir.req) for ir in INSTALL_REQS]

setup(name='hbp-app-python-auth',
      version=VERSION,
      description='hbp collaboratory python oauth2 module',
      packages=['hbp_app_python_auth'],
      author='bbp platform team',