예제 #1
0
def build(setup_kwargs):
    """Construct the extensions and distribution."""  # noqa
    extensions = _build_extensions()
    distribution = _build_distribution(extensions)

    # Build and run the command
    cmd: build_ext = build_ext(distribution)
    cmd.parallel = os.cpu_count()
    cmd.ensure_finalized()
    cmd.run()

    # Copy the build back into the project for packaging
    _copy_build_dir_to_project(cmd)

    return setup_kwargs
예제 #2
0
def build() -> None:
    """Construct the extensions and distribution."""  # noqa
    # Create C Extensions to feed into cythonize()
    extensions = _build_extensions()
    distribution = _build_distribution(extensions)

    # Build and run the command
    print("Compiling C extension modules...")
    cmd: build_ext = build_ext(distribution)
    if PARALLEL_BUILD:
        cmd.parallel = os.cpu_count()
    cmd.ensure_finalized()
    cmd.run()

    if not SKIP_BUILD_COPY:
        # Copy the build back into the project for development and packaging
        _copy_build_dir_to_project(cmd)