How to use the cibuildwheel.util.DependencyConstraints 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 / __main__.py View on Github external
build_selector = BuildSelector(build_config, skip_config)

    try:
        environment = parse_environment(environment_config)
    except (EnvironmentParseError, ValueError):
        print(f'cibuildwheel: Malformed environment option "{environment_config}"', file=sys.stderr)
        traceback.print_exc(None, sys.stderr)
        exit(2)

    if dependency_versions == 'pinned':
        dependency_constraints: Optional[DependencyConstraints] = DependencyConstraints.with_defaults()
    elif dependency_versions == 'latest':
        dependency_constraints = None
    else:
        dependency_versions_path = Path(dependency_versions)
        dependency_constraints = DependencyConstraints(dependency_versions_path)

    if test_extras:
        test_extras = f'[{test_extras}]'

    try:
        build_verbosity = min(3, max(-3, int(build_verbosity_str)))
    except ValueError:
        build_verbosity = 0

    # Add CIBUILDWHEEL environment variable
    # This needs to be passed on to the docker container in linux.py
    os.environ['CIBUILDWHEEL'] = '1'

    if not any((package_dir / name).exists()
               for name in ["setup.py", "setup.cfg", "pyproject.toml"]):
        print('cibuildwheel: Could not find setup.py, setup.cfg or pyproject.toml at root of package', file=sys.stderr)
github joerick / cibuildwheel / cibuildwheel / util.py View on Github external
specific_file_path = specific + ext
        if os.path.exists(specific_file_path):
            return specific_file_path
        else:
            return self.base_file_path


class BuildOptions(NamedTuple):
    package_dir: str
    output_dir: str
    build_selector: BuildSelector
    environment: ParsedEnvironment
    before_build: Optional[str]
    repair_command: str
    manylinux_images: Optional[Dict[str, str]]
    dependency_constraints: Optional[DependencyConstraints]
    test_command: Optional[str]
    before_test: Optional[str]
    test_requires: List[str]
    test_extras: str
    build_verbosity: int


resources_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'resources'))
get_pip_script = os.path.join(resources_dir, 'get-pip.py')
github joerick / cibuildwheel / cibuildwheel / util.py View on Github external
def with_defaults() -> 'DependencyConstraints':
        return DependencyConstraints(
            base_file_path=os.path.join(os.path.dirname(__file__), 'resources', 'constraints.txt')
        )