本文整理汇总了Python中optparse.Option.isolated_mode方法的典型用法代码示例。如果您正苦于以下问题:Python Option.isolated_mode方法的具体用法?Python Option.isolated_mode怎么用?Python Option.isolated_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类optparse.Option
的用法示例。
在下文中一共展示了Option.isolated_mode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_reqs
# 需要导入模块: from optparse import Option [as 别名]
# 或者: from optparse.Option import isolated_mode [as 别名]
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]
示例2: parse_reqs
# 需要导入模块: from optparse import Option [as 别名]
# 或者: from optparse.Option import isolated_mode [as 别名]
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]
示例3: Option
# 需要导入模块: from optparse import Option [as 别名]
# 或者: from optparse.Option import isolated_mode [as 别名]
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
)
reqs = [str(ir.req) for ir in requirements]
config = {
'description': 'Mouse Locomotion Simulation',
'author': 'HBP Neurorobotics',
'url': 'http://neurorobotics.net',
'author_email': '[email protected]',
'version': src.__version__,
'install_requires': reqs,
'packages': ['src',
示例4: Option
# 需要导入模块: from optparse import Option [as 别名]
# 或者: from optparse.Option import isolated_mode [as 别名]
#!/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',