當前位置: 首頁>>代碼示例>>Python>>正文


Python locations.distutils_scheme方法代碼示例

本文整理匯總了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']] 
開發者ID:HaoZhang95,項目名稱:Python24,代碼行數:5,代碼來源:install.py

示例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 
開發者ID:mbj4668,項目名稱:pyang,代碼行數:28,代碼來源:test_prefix_deviation.py

示例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'] 
開發者ID:guildai,項目名稱:guildai,代碼行數:15,代碼來源:pip_util.py


注:本文中的pip._internal.locations.distutils_scheme方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。