本文整理汇总了Python中distutils.command.build.build方法的典型用法代码示例。如果您正苦于以下问题:Python build.build方法的具体用法?Python build.build怎么用?Python build.build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.command.build
的用法示例。
在下文中一共展示了build.build方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_calmjs_artifacts
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def build_calmjs_artifacts(dist, key, value, cmdclass=BuildCommand):
"""
Trigger the artifact build process through the setuptools.
"""
if value is not True:
return
build_cmd = dist.get_command_obj('build')
if not isinstance(build_cmd, cmdclass):
logger.error(
"'build' command in Distribution is not an instance of "
"'%s:%s' (got %r instead)",
cmdclass.__module__, cmdclass.__name__, build_cmd)
return
build_cmd.sub_commands.append((key, has_calmjs_artifact_declarations))
示例2: finalize_options
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def finalize_options(self):
# Finalize previous commands
self.distribution.finalize_options()
self.build.ensure_finalized()
# Shortcuts
self.extensions = self.distribution.rust_extensions
self.workspace = os.path.abspath(
os.path.dirname(self.distribution.script_name) or "."
)
# Build list of authors
if self.authors is not None:
sep = "\n" if "\n" in self.authors.strip() else ","
self.authors = "[{}]".format(
", ".join(author.strip() for author in self.authors.split(sep))
)
else:
self.authors = '["{} <{}>"]'.format(
self.distribution.get_author(),
self.distribution.get_author_email().strip("\"'"),
)
示例3: check_coin_version
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def check_coin_version(self):
'''
check the Coin version
'''
print(yellow('\ncheck_coin_version is not supported in this version'))
print(yellow('coin-bindings are build by default'))
print(yellow('checks have been disabled because of missing config files'))
print(yellow('make sure you have installed the coin library + headers!'))
return #TODO
if sys.platform == "win32":
return
if not self.check_cmd_exists("coin-config"):
sys.exit(1)
print(blue("Coin version..."))
version = self.do_os_popen("coin-config --version")
print(blue("%s" % version))
# if not version.startswith('3'):
# print(yellow("** Warning: Pivy has only been tested with Coin "
# "versions Coin-dev 3."))
示例4: finalize_options
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def finalize_options(self):
self.set_undefined_options('config',
('q_home', 'q_home'),
('q_arch', 'q_arch'),
('q_version', 'q_version'))
self.set_undefined_options('build',
('build_base', 'build_base'),
('compiler', 'compiler'),
('debug', 'debug'),
('force', 'force'),
('plat_name', 'plat_name'))
if self.build_lib is None:
self.build_lib = os.path.join(self.build_base,
'qext.' + self.plat_name)
if self.build_temp is None:
self.build_temp = os.path.join(self.build_base,
'temp.' + self.plat_name)
if self.extensions is None:
self.extensions = self.distribution.qext_modules
if self.define is None:
split_version = self.q_version.split('.')
self.define = [('KXVER', split_version[0]),
('KXVER2', split_version[1]), ]
示例5: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self):
"""
Run first the related KIWI C compilation and after that
the usual Python build
"""
# kiwi C tools compilation
command = ['make']
if self.cflags:
command.append('CFLAGS=%s' % self.cflags)
command.append('python_version={0}'.format(python_version))
command.append('tools')
self.announce(
'Running make tools target: %s' % str(command),
level=distutils.log.INFO
)
self.announce(
subprocess.check_output(command).decode(),
level=distutils.log.INFO
)
# standard build process
distutils_build.build.run(self)
示例6: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self):
global path
## Make sure build directory is clean
buildPath = os.path.join(path, self.build_lib)
if os.path.isdir(buildPath):
distutils.dir_util.remove_tree(buildPath)
ret = build.build.run(self)
示例7: test_finalize_options
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def test_finalize_options(self):
pkg_dir, dist = self.create_dist()
cmd = build(dist)
cmd.finalize_options()
# if not specified, plat_name gets the current platform
self.assertEqual(cmd.plat_name, get_platform())
# build_purelib is build + lib
wanted = os.path.join(cmd.build_base, 'lib')
self.assertEqual(cmd.build_purelib, wanted)
# build_platlib is 'build/lib.platform-x.x[-pydebug]'
# examples:
# build/lib.macosx-10.3-i386-2.7
plat_spec = '.%s-%s' % (cmd.plat_name, sys.version[0:3])
if hasattr(sys, 'gettotalrefcount'):
self.assertTrue(cmd.build_platlib.endswith('-pydebug'))
plat_spec += '-pydebug'
wanted = os.path.join(cmd.build_base, 'lib' + plat_spec)
self.assertEqual(cmd.build_platlib, wanted)
# by default, build_lib = build_purelib
self.assertEqual(cmd.build_lib, cmd.build_purelib)
# build_temp is build/temp.<plat>
wanted = os.path.join(cmd.build_base, 'temp' + plat_spec)
self.assertEqual(cmd.build_temp, wanted)
# build_scripts is build/scripts-x.x
wanted = os.path.join(cmd.build_base, 'scripts-' + sys.version[0:3])
self.assertEqual(cmd.build_scripts, wanted)
# executable is os.path.normpath(sys.executable)
self.assertEqual(cmd.executable, os.path.normpath(sys.executable))
示例8: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self):
self.run_command('build')
_install.run(self)
示例9: initialize_options
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def initialize_options(self):
self.dependencies = None
self.authors = None
self.create_workspace = None
self.no_config = None
self.force = None
# use the build command to find build directories
self.build = build(self.distribution)
# parse config files
self.cfg = configparser.ConfigParser()
self.cfg.read(self.distribution.find_config_files())
示例10: build_cargo_toml
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def build_cargo_toml(self, ext):
# Shortcuts
quote = '"{}"'.format
dist = self.distribution
# Use a ConfigParser object to build a TOML file (hackish)
toml = configparser.ConfigParser()
# The directory where the extension's manifest is located
tomldir = os.path.dirname(ext.path)
# If the RustExtension was not created by `find_rust_extensions`
# the `lib.rs` file is expected to be located near `Cargo.toml`
if not hasattr(ext, "libfile"):
ext.libfile = ext.path.replace("Cargo.toml", "lib.rs")
# Create a small package section
toml.add_section("package")
toml.set("package", "name", quote(ext.name.replace('.', '-')))
toml.set("package", "version", quote(dist.get_version()))
toml.set("package", "authors", self.authors)
toml.set("package", "publish", "false")
# Add the relative path to the workspace if any
if self.create_workspace:
path_to_workspace = os.path.relpath(self.workspace, tomldir)
toml.set("package", "workspace", quote(path_to_workspace))
# Create a small lib section
toml.add_section("lib")
toml.set("lib", "crate-type", '["cdylib"]')
toml.set("lib", "name", quote(_slugify(ext.name)))
toml.set("lib", "path", quote(os.path.relpath(ext.libfile, tomldir)))
# Find dependencies within the `setup.cfg` file of the project
toml.add_section("dependencies")
for dep, options in self.iter_dependencies(ext):
toml.set("dependencies", dep, options)
return toml
示例11: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self, *args, **kwargs):
build = self.get_finalized_command('build')
_compile_postgres(
pathlib.Path(build.build_base).resolve(),
force_build=True,
fresh_build=self.fresh_build,
run_configure=self.configure,
build_contrib=self.build_contrib)
示例12: check_gui_bindings
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def check_gui_bindings(self):
'''check for availability of SoGui bindings and removes the not available ones'''
print(yellow('\ncheck_gui_bindings is not supported in this version'))
print(yellow('soqt is build by default'))
print(yellow('make sure you have installed the soqt library + headers\n'))
return #TODO
if sys.platform == "_win32":
self.MODULES.pop('soxt', None)
self.MODULES.pop('sogtk', None)
print(blue("Checking for SoWin..."))
if not os.path.exists(os.path.join(os.getenv("COINDIR"), "include", "Inventor", "Win", "SoWin.h")):
self.MODULES.pop('sowin', None)
print(red("COINDIR\\include\\Inventor\\Win\\SoWin.h not found. (SoWin bindings won't be built)"))
print(blue("Checking for QTDIR environment variable..."))
if os.getenv("QTDIR"):
print(blue(os.getenv("QTDIR")))
else:
self.MODULES.pop('soqt', None)
print(red("not set. (SoQt bindings won't be built)"))
else:
for gui in self.SOGUI:
if gui not in self.MODULES:
continue
gui_config_cmd = self.MODULES[gui][1]
if not self.check_cmd_exists(gui_config_cmd):
self.MODULES.pop(gui, None)
else:
print(blue("Checking for %s version..." % gui))
version = self.do_os_popen("%s --version" % gui_config_cmd)
print(blue("%s" % version))
示例13: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self):
"the entry point for the distutils build class"
# if sys.platform == "win32" and not os.getenv("COINDIR"):
# print("Please set the COINDIR environment variable to your Coin root directory! ** Aborting **")
# sys.exit(1)
self.pivy_configure()
self.swig_generate()
for cmd_name in self.get_sub_commands():
self.run_command(cmd_name)
示例14: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self):
"the entry point for the distutils build class"
if sys.platform == "win32" and not os.getenv("COINDIR"):
print("Please set the COINDIR environment variable to your Coin root directory! ** Aborting **")
sys.exit(1)
self.pivy_configure()
self.swig_generate()
for cmd_name in self.get_sub_commands():
self.run_command(cmd_name)
示例15: run
# 需要导入模块: from distutils.command import build [as 别名]
# 或者: from distutils.command.build import build [as 别名]
def run(self):
"""Call build_man then proceed as normal."""
self.run_command('build_man')
bdist_egg.run(self)
# Ensure that man pages are regenerated whenever build/sdist are run
# setup.py sdist --sub_commands--> build_man