Skip to content

Conversation

@mayeut
Copy link
Member

@mayeut mayeut commented Jan 25, 2025

This is a follow up of #1873 (comment)

I changed a bit the layout from the comment to split a bit more cibuildwheel.utils

util/cmd.py:
    call
    shell

util/file.py:
    download
    extract_zip
    extract_tar
    move_file
    chdir
    test_fail_cwd_file
    DEFAULT_CIBW_CACHE_PATH
    CIBW_CACHE_PATH
    # moved/renamed to/in resources module compared to original comment
    # resources_dir
    # install_certifi_script
    # free_thread_enable_313

selector.py: => moved to package root
    BuildSelector
    TestSelector
    selector_matches

ci.py: => moved to package root
    detect_ci_provider
    CIProvider
    fix_ansi_codes_for_github_actions

util/packaging.py:
    find_compatible_wheel
    DependencyConstraints
    get_pip_version
    combine_constraints
    # moved to venv module compared to original comment
    # find_uv => moved to venv module
    # virtualenv => moved to venv module
    # _parse_constraints_for_virtualenv => moved to venv module
    # _ensure_virtualenv => moved to venv module
    # moved to frontend module compared to original comment
    # get_build_verbosity_extra_flags
    # split_config_settings
    # BuildFrontendName
    # BuildFrontendConfig

util/helpers.py:
    format_safe
    prepare_command
    strtobool
    unwrap
    parse_key_value_string
    # moved to resources module compared to original comment
    # read_python_configs

move to __main__:
    FileReport
    Unbuffered
    print_new_wheels

move to pyodide.py:
    ensure_node

move to options.py:
    MANYLINUX_ARCHS
    MUSLLINUX_ARCHS

inline where needed:
    IS_WIN

# new modules compared to original comment
util/resources.py:
    resources_dir => PATH
    install_certifi_script => INSTALL_CERTIFI_SCRIPT
    free_thread_enable_313 => FREE_THREAD_ENABLE_313
    read_python_configs

venv.py:
    find_uv
    virtualenv
    _parse_constraints_for_virtualenv
    _ensure_virtualenv

frontend.py
    get_build_verbosity_extra_flags
    split_config_settings
    BuildFrontendName
    BuildFrontendConfig

close #1873
fix #1857

@mayeut
Copy link
Member Author

mayeut commented Jan 25, 2025

qemu tests are failing because of:
xref docker/setup-qemu-action#188
xref tonistiigi/binfmt#215

test_container_removed[docker] is flaky on GHA aarch64

Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha I have a local branch with almost exactly the same work on it, did it on Friday morning. No matter. I actually think I like your version better, I also moved some bits to a resources module, but yours moves a few bits out of util (ci, frontend), which makes sense to me.

I think it's worth getting this in relatively quickly, to minimise merge conflict misery.

Copy link
Contributor

@henryiii henryiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sooner rather than later sounds good to me!

@henryiii henryiii merged commit b605f8f into pypa:main Jan 27, 2025
25 checks passed
@mayeut mayeut deleted the refactor-utils branch January 27, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split utils.py into multiple coherent modules

3 participants