本文整理汇总了Python中pip._internal.build_env.NoOpBuildEnvironment方法的典型用法代码示例。如果您正苦于以下问题:Python build_env.NoOpBuildEnvironment方法的具体用法?Python build_env.NoOpBuildEnvironment怎么用?Python build_env.NoOpBuildEnvironment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip._internal.build_env
的用法示例。
在下文中一共展示了build_env.NoOpBuildEnvironment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: prep_for_dist
# 需要导入模块: from pip._internal import build_env [as 别名]
# 或者: from pip._internal.build_env import NoOpBuildEnvironment [as 别名]
def prep_for_dist(self, finder, build_isolation):
# Before calling "setup.py egg_info", we need to set-up the build
# environment.
build_requirements, isolate = self.req.get_pep_518_info()
should_isolate = build_isolation and isolate
minimum_requirements = ('setuptools', 'wheel')
missing_requirements = set(minimum_requirements) - set(
pkg_resources.Requirement(r).key
for r in build_requirements
)
if missing_requirements:
def format_reqs(rs):
return ' and '.join(map(repr, sorted(rs)))
logger.warning(
"Missing build time requirements in pyproject.toml for %s: "
"%s.", self.req, format_reqs(missing_requirements)
)
logger.warning(
"This version of pip does not implement PEP 517 so it cannot "
"build a wheel without %s.", format_reqs(minimum_requirements)
)
if should_isolate:
with self.req.build_env:
pass
_install_build_reqs(finder, self.req.build_env.path,
build_requirements)
else:
self.req.build_env = NoOpBuildEnvironment(no_clean=False)
self.req.run_egg_info()
self.req.assert_source_matches_version()
示例2: prep_for_dist
# 需要导入模块: from pip._internal import build_env [as 别名]
# 或者: from pip._internal.build_env import NoOpBuildEnvironment [as 别名]
def prep_for_dist(self, finder, build_isolation):
# Before calling "setup.py egg_info", we need to set-up the build
# environment.
build_requirements, isolate = self.req.get_pep_518_info()
should_isolate = build_isolation and isolate
minimum_requirements = ('setuptools', 'wheel')
missing_requirements = set(minimum_requirements) - set(
pkg_resources.Requirement(r).key
for r in build_requirements
)
if missing_requirements:
def format_reqs(rs):
return ' and '.join(map(repr, sorted(rs)))
logger.warning(
"Missing build time requirements in pyproject.toml for %s: "
"%s.", self.req, format_reqs(missing_requirements)
)
logger.warning(
"This version of pip does not implement PEP 517 so it cannot "
"build a wheel without %s.", format_reqs(minimum_requirements)
)
if should_isolate:
with self.req.build_env as prefix:
_install_build_reqs(finder, prefix, build_requirements)
else:
self.req.build_env = NoOpBuildEnvironment(no_clean=False)
self.req.run_egg_info()
self.req.assert_source_matches_version()
示例3: __init__
# 需要导入模块: from pip._internal import build_env [as 别名]
# 或者: from pip._internal.build_env import NoOpBuildEnvironment [as 别名]
def __init__(self, req, comes_from, source_dir=None, editable=False,
link=None, update=True, markers=None,
isolated=False, options=None, wheel_cache=None,
constraint=False, extras=()):
assert req is None or isinstance(req, Requirement), req
self.req = req
self.comes_from = comes_from
self.constraint = constraint
if source_dir is not None:
self.source_dir = os.path.normpath(os.path.abspath(source_dir))
else:
self.source_dir = None
self.editable = editable
self._wheel_cache = wheel_cache
if link is not None:
self.link = self.original_link = link
else:
from pip._internal.index import Link
self.link = self.original_link = req and req.url and Link(req.url)
if extras:
self.extras = extras
elif req:
self.extras = {
pkg_resources.safe_extra(extra) for extra in req.extras
}
else:
self.extras = set()
if markers is not None:
self.markers = markers
else:
self.markers = req and req.marker
self._egg_info_path = None
# This holds the pkg_resources.Distribution object if this requirement
# is already available:
self.satisfied_by = None
# This hold the pkg_resources.Distribution object if this requirement
# conflicts with another installed distribution:
self.conflicts_with = None
# Temporary build location
self._temp_build_dir = TempDirectory(kind="req-build")
# Used to store the global directory where the _temp_build_dir should
# have been created. Cf _correct_build_location method.
self._ideal_build_dir = None
# True if the editable should be updated:
self.update = update
# Set to True after successful installation
self.install_succeeded = None
# UninstallPathSet of uninstalled distribution (for possible rollback)
self.uninstalled_pathset = None
self.options = options if options else {}
# Set to True after successful preparation of this requirement
self.prepared = False
self.is_direct = False
self.isolated = isolated
self.build_env = NoOpBuildEnvironment()
# Constructors
# TODO: Move these out of this class into custom methods.