How to use the cibuildwheel.util.get_build_verbosity_extra_flags function in cibuildwheel

To help you get started, we’ve selected a few cibuildwheel 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 joerick / cibuildwheel / cibuildwheel / windows.py View on Github external
# install Python
        env = setup_python(config, dependency_constraint_flags, options.environment)

        # run the before_build command
        if options.before_build:
            before_build_prepared = prepare_command(options.before_build, project='.', package=options.package_dir)
            shell([before_build_prepared], env=env)

        # build the wheel
        if built_wheel_dir.exists():
            shutil.rmtree(built_wheel_dir)
        built_wheel_dir.mkdir(parents=True)
        # Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
        # see https://github.com/joerick/cibuildwheel/pull/369
        shell(['pip', 'wheel', str(options.package_dir.resolve()), '-w', str(built_wheel_dir), '--no-deps'] + get_build_verbosity_extra_flags(options.build_verbosity), env=env)
        built_wheel = next(built_wheel_dir.glob('*.whl'))

        # repair the wheel
        if repaired_wheel_dir.exists():
            shutil.rmtree(repaired_wheel_dir)
        repaired_wheel_dir.mkdir(parents=True)
        if built_wheel.name.endswith('none-any.whl') or not options.repair_command:
            # pure Python wheel or empty repair command
            built_wheel.rename(repaired_wheel_dir / built_wheel.name)
        else:
            repair_command_prepared = prepare_command(options.repair_command, wheel=built_wheel, dest_dir=repaired_wheel_dir)
            shell([repair_command_prepared], env=env)
        repaired_wheel = next(repaired_wheel_dir.glob('*.whl'))

        if options.test_command:
            # set up a virtual environment to install and test from, to make sure
github joerick / cibuildwheel / cibuildwheel / linux.py View on Github external
if options.before_build:
                        before_build_prepared = prepare_command(options.before_build, project='/project', package=container_package_dir)
                        docker.call(['sh', '-c', before_build_prepared], env=env)

                    temp_dir = PurePath('/tmp/cibuildwheel')
                    built_wheel_dir = temp_dir / 'built_wheel'
                    docker.call(['rm', '-rf', built_wheel_dir])
                    docker.call(['mkdir', '-p', built_wheel_dir])

                    docker.call([
                        'pip', 'wheel',
                        container_package_dir,
                        '-w', built_wheel_dir,
                        '--no-deps',
                        *get_build_verbosity_extra_flags(options.build_verbosity)
                    ], env=env)

                    built_wheel = docker.glob(built_wheel_dir / '*.whl')[0]

                    repaired_wheel_dir = temp_dir / 'repaired_wheel'
                    docker.call(['rm', '-rf', repaired_wheel_dir])
                    docker.call(['mkdir', '-p', repaired_wheel_dir])

                    if built_wheel.name.endswith('none-any.whl') or not options.repair_command:
                        docker.call(['mv', built_wheel, repaired_wheel_dir])
                    else:
                        repair_command_prepared = prepare_command(options.repair_command, wheel=built_wheel, dest_dir=repaired_wheel_dir)
                        docker.call(['sh', '-c', repair_command_prepared], env=env)

                    repaired_wheels = docker.glob(repaired_wheel_dir / '*.whl')
github joerick / cibuildwheel / cibuildwheel / macos.py View on Github external
]

        env = setup_python(config, dependency_constraint_flags, options.environment)

        # run the before_build command
        if options.before_build:
            before_build_prepared = prepare_command(options.before_build, project='.', package=options.package_dir)
            call(before_build_prepared, env=env, shell=True)

        # build the wheel
        if built_wheel_dir.exists():
            shutil.rmtree(built_wheel_dir)
        built_wheel_dir.mkdir(parents=True)
        # Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
        # see https://github.com/joerick/cibuildwheel/pull/369
        call(['pip', 'wheel', str(options.package_dir.resolve()), '-w', str(built_wheel_dir), '--no-deps'] + get_build_verbosity_extra_flags(options.build_verbosity), env=env)
        built_wheel = next(built_wheel_dir.glob('*.whl'))

        # repair the wheel
        if repaired_wheel_dir.exists():
            shutil.rmtree(repaired_wheel_dir)
        repaired_wheel_dir.mkdir(parents=True)
        if built_wheel.name.endswith('none-any.whl') or not options.repair_command:
            # pure Python wheel or empty repair command
            built_wheel.rename(repaired_wheel_dir / built_wheel.name)
        else:
            repair_command_prepared = prepare_command(options.repair_command, wheel=built_wheel, dest_dir=repaired_wheel_dir)
            call(repair_command_prepared, env=env, shell=True)
        repaired_wheel = next(repaired_wheel_dir.glob('*.whl'))

        if options.test_command:
            # set up a virtual environment to install and test from, to make sure