How to use the build.build function in build

To help you get started, we’ve selected a few build examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github schubergphilis / towerlib / _CI / scripts / upload.py View on Github external
def upload():
    success = build()
    if not success:
        LOGGER.error('Errors caught on building the artifact, bailing out...')
        raise SystemExit(1)
    if not validate_environment_variable_prerequisites(PREREQUISITES.get('upload_environment_variables', [])):
        LOGGER.error('Prerequisite environment variable for upload missing, cannot continue.')
        raise SystemExit(1)
    upload_command = ('twine upload dist/* '
                      f'-u {os.environ.get("PYPI_UPLOAD_USERNAME")} '
                      f'-p {os.environ.get("PYPI_UPLOAD_PASSWORD")} '
                      '--skip-existing '
                      f'--repository-url {os.environ.get("PYPI_URL")}')
    LOGGER.info('Trying to upload built artifact...')
    success = execute_command(upload_command)
    if success:
        LOGGER.info('%s Successfully uploaded artifact! %s',
                    emojize(':white_heavy_check_mark:'),
github costastf / toonapilib / _CI / scripts / upload.py View on Github external
def upload():
    success = build()
    if not success:
        LOGGER.error('Errors caught on building the artifact, bailing out...')
        raise SystemExit(1)
    if not validate_environment_variable_prerequisites(PREREQUISITES.get('upload_environment_variables', [])):
        LOGGER.error('Prerequisite environment variable for upload missing, cannot continue.')
        raise SystemExit(1)
    upload_command = ('twine upload dist/* '
                      f'-u {os.environ.get("PYPI_UPLOAD_USERNAME")} '
                      f'-p {os.environ.get("PYPI_UPLOAD_PASSWORD")} '
                      '--skip-existing '
                      f'--repository-url {os.environ.get("PYPI_URL")}')
    LOGGER.info('Trying to upload built artifact...')
    success = execute_command(upload_command)
    if success:
        LOGGER.info('%s Successfully uploaded artifact! %s',
                    emojize(':white_heavy_check_mark:'),
github VCVRack / library / scripts / update.py View on Github external
if os.path.isdir(plugin_filename):
		# Check if the library manifest is up to date
		try:
			with open(library_manifest_filename, "r") as f:
				library_manifest = json.load(f)
			if library_manifest and version == library_manifest['version']:
				continue
		except IOError:
			pass

		# Build repo
		print()
		print(f"Building {slug}")
		try:
			build.delete_stage()
			build.build(plugin_filename)
			build.system(f'cp -vi stage/* "{PACKAGES_DIR}"')
			build.system(f'cp -vi stage/* "{RACK_USER_PLUGIN_DIR}"')
		except Exception as e:
			print(e)
			print(f"{slug} build failed")
			input()
			continue
		finally:
			build.delete_stage()

		# Open plugin issue thread
		os.system(f"qutebrowser 'https://github.com/VCVRack/library/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+in%3Atitle+{slug}' &")

	elif plugin_ext == ".zip":
		# Review manifest for errors
		print(json.dumps(manifest, indent="  "))
github Dot-H / sac / src / python-module / sac.py View on Github external
def edit(self, paths):
        gdb.write("Building... ", gdb.STDERR);
        path = build(paths, self.builds, self.default_build)
        if not path:
            gdb.write("Failed\n", gdb.STDERR)
            return False
        gdb.write("Done\n");

        if not patch_objfile(path, self.patches, self.families):
            gdb.write("Failed to change {0}\n".format(path), gdb.STDERR)

        return True
github facebookresearch / ParlAI / parlai / tasks / talkthewalk / run.py View on Github external
def _path(opt):
    build(opt)
    opt['ttw_data'] = os.path.join(opt['datapath'], 'TalkTheWalk')
github FTSRG / trainbenchmark / scripts / run.py View on Github external
for format in config["formats"]:
            for format_name, _ in format.items():
                format_names.add(format_name)
    else:
        for tool_name in tool_names:
            format_names.add(tool_formats[tool_name])

    # Run the framework. If there are no args, execute a full sequence
    # with the test and the visualization/reporting.
    no_args = all(val is False for val in vars(args).values())
    if no_args:
        args.build = True
        args.generate = True
        args.measure = True
    if args.build or args.test:
        build.build(build_java_opts, format_names, tool_names, args.skip_tests, args.test, args.offline)
    if args.generate:
        generate.generate_models(generator_java_opts, formats, scenarios, sizes)
    if args.measure:
        measure.measure_tools(measurement_java_opts, timeout, runs, scenarios, sizes, tools, query_mixes, email, max_levels, max_memory)
github RTEMS / rtems-source-builder / source-builder / sb / getsources.py View on Github external
# Each section of the build set gets a separate set of
                    # macros so we do not contaminate one configuration with
                    # another.
                    #
                    opts = copy.copy(self.opts)
                    macros = copy.copy(self.macros)
                    self.set_host_details(host, opts, macros)
                    if configs[s].endswith('.bset'):
                        log.trace('_bset: == %2d %s' % (nesting_count + 1, '=' * 75))
                        bs = buildset(configs[s], self.configs, opts, macros)
                        bs.build(host, nesting_count)
                        del bs
                    elif configs[s].endswith('.cfg'):
                        log.trace('_bset: -- %2d %s' % (nesting_count + 1, '-' * 75))
                        try:
                            b = build.build(configs[s],
                                            False,
                                            opts,
                                            macros)
                        except:
                            build_error = True
                            raise
                        self.build_package(configs[s], b)
                        builds += [b]
                        #
                        # Dump post build macros.
                        #
                        log.trace('_bset: macros post-build')
                        log.trace(str(macros))
                    else:
                        raise error.general('invalid config type: %s' % (configs[s]))
                except error.general as gerr:
github KhronosGroup / VK-GL-CTS / external / openglcts / scripts / build_android.py View on Github external
import os
import sys
import argparse

sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "android", "scripts"))

import build

if __name__ == "__main__":
	parser = argparse.ArgumentParser()

	parser.add_argument('--glcts-gtf-target', dest='gtfTarget', default='gles32', choices=['gles32', 'gles31', 'gles3', 'gles2', 'gl'], help="Build GLCTS GTF module for the given API.")
	args = parser.parse_args()

	build.build(package='openglcts', gtfTarget=args.gtfTarget)
github openai / procgen / setup.py View on Github external
def run(self):
        if self.inplace:
            print("skipping inplace build, extension will be built on demand")
            return
        sys.path.append(PACKAGE_ROOT)
        import build

        lib_dir = build.build(package=True)
        # move into the build_lib directory so that the shared library
        # can be included in the package
        # we will also check for this file at runtime to avoid doing
        # the on-demand build
        for filename in ["libenv.so", "libenv.dylib", "env.dll"]:
            src = os.path.join(lib_dir, filename)
            dst = os.path.join(self.build_lib, "procgen", "build", filename)
            if os.path.exists(src):
                os.makedirs(os.path.dirname(dst), exist_ok=True)
                os.replace(src, dst)
github validator / validator / checker.py View on Github external
args = [
  '--connection-timeout=15',
  '--socket-timeout=15',
  '--name=Ready to check',
  '--results-title=Showing results',
  '--page-template=site/NuPageEmitter.xml',
  '--form-template=site/NuFormEmitter.xml',
  '--about-file=site/nu-about.html',
  '--script-file=site/nu-script.js',
  '--stylesheet-file=site/nu-style.css'
]

if len(sys.argv) > 1:
    args.extend(sys.argv[1:])
    build.main(args)
else:
    build.printHelp()