本文整理汇总了Python中pip._internal.locations.distutils_scheme方法的典型用法代码示例。如果您正苦于以下问题:Python locations.distutils_scheme方法的具体用法?Python locations.distutils_scheme怎么用?Python locations.distutils_scheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip._internal.locations
的用法示例。
在下文中一共展示了locations.distutils_scheme方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_lib_location_guesses
# 需要导入模块: from pip._internal import locations [as 别名]
# 或者: from pip._internal.locations import distutils_scheme [as 别名]
def get_lib_location_guesses(*args, **kwargs):
scheme = distutils_scheme('', *args, **kwargs)
return [scheme['purelib'], scheme['platlib']]
示例2: test_can_find_modules_when_prefix_differ
# 需要导入模块: from pip._internal import locations [as 别名]
# 或者: from pip._internal.locations import distutils_scheme [as 别名]
def test_can_find_modules_when_prefix_differ(monkeypatch):
"""
context should find the default installed modules, without the help
of environment variables, even of the pip install location
differs from ``sys.prefix``
"""
# store pip location.
# monkeypatching sys.prefix will side_effect scheme.
scheme = locations.distutils_scheme('pyang')
monkeypatch.setattr(
locations, 'distutils_scheme', lambda *_: scheme)
# simulate #225 description
monkeypatch.setattr(sys, 'prefix', '/usr')
# remove obfuscation from env vars
if os.environ.get('YANG_INSTALL'):
del os.environ['YANG_INSTALL']
if os.environ.get('YANG_MODPATH'):
del os.environ['YANG_MODPATH']
ctx = create_context()
module = ctx.search_module(None, EXISTING_MODULE)
assert module is not None
示例3: lib_dir
# 需要导入模块: from pip._internal import locations [as 别名]
# 或者: from pip._internal.locations import distutils_scheme [as 别名]
def lib_dir(
name, wheeldir, user=False, home=None, root=None, isolated=False, prefix=None
):
from pip._internal.locations import distutils_scheme
from pip._internal.wheel import root_is_purelib
scheme = distutils_scheme(
"", user=user, home=home, root=root, isolated=isolated, prefix=prefix
)
if root_is_purelib(name, wheeldir):
return scheme['purelib']
else:
return scheme['platlib']