Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] [python-package] run macOS x86_64 tests on macOS 12 (Monterey), stop manually setting macOS wheel tags #6487

Merged
merged 7 commits into from
Jun 17, 2024

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Jun 17, 2024

Description

Follow-up to #5328

Proposes some changes to macOS packaging:

  • drop testing on macOS Big Sur (11.x) and use Monterey (12.x) on Azure DevOps
  • stop manually setting wheel tags and let scikit-build-core automatically determine them

Notes for Reviewers

Why drop Big Sur testing?

Azure DevOps is dropping support for macOS Big Sur (11.x). See these warnings at the top of all the recent Azure DevOps builds here:

Following macOS 11 End of Support by Apple, macOS 11 images will be removed on 28th June.

(example build link)

According to https://endoflife.date/macos, Big Sur support ended in September 2023

image

List of supported Microsoft-hosted Azure DevOps images: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#use-a-microsoft-hosted-agent

Why let scikit-build-core choose the platform target?

  • should be less error-prone than doing it manually with mv
  • decouples "what macOS versions does this support" from "what version of macOS was it built on?

This would result in supporting a wider range of macOS versions with lightgbm's wheels than the last release (v4.4.0) did. For example, in 4.4.40 lightgbm has this:

# arm64: macOS >= 14.0
lightgbm-4.4.0-py3-none-macosx_14_0_arm64.whl 

# x86_64: macOS >= 10.15
lightgbm-4.4.0-py3-none-macosx_10_15_x86_64.macosx_11_6_x86_64.macosx_12_5_x86_64.whl 

ref: https://pypi.org/project/lightgbm/4.4.0/#files

As of this PR, lightgbm would support:

# arm64: macOS >= 12.0
lightgbm-4.4.0-py3-none-macosx_12_0_arm64.whl

# x86_64: macOS >= 10.15
lightgbm-4.4.0-py3-none-macosx_10_15_x86_64.whl

CI logs:

How does automatic determination of the tag work?

scikit-build-core determines the range of macOS versions by inspecting the MACOSX_DEPLOYMENT_TARGET environment variable where available, and otherwise falling back to platform.mac_ver().

https://github.com/scikit-build/scikit-build-core/blob/acb7d0346e4a05bcb47a4ea3939c705ab71e3145/src/scikit_build_core/builder/macos.py#L36

Using this mechanism instead of manual renaming allows building wheels that target macOS versions older than whatever version the CI build is running on, to continue to support users on older systems. This is how xgboost, for example, is able to continue producing wheels that support macOS 10.X (Catalina).

https://github.com/dmlc/xgboost/blob/6c83c8c2efdb522472c1d23349ab64320d455443/tests/ci_build/build_python_wheels.sh#L38

https://pypi.org/project/xgboost/2.0.3/#files

It should also be less error-prone than manually setting tags by renaming files.

@jameslamb jameslamb marked this pull request as draft June 17, 2024 01:24
@jameslamb jameslamb changed the title [ci] drop macOS 11 (Big Sur) support WIP: [ci] drop macOS 11 (Big Sur) support Jun 17, 2024
@jameslamb jameslamb changed the title WIP: [ci] drop macOS 11 (Big Sur) support WIP: [ci] drop macOS 11 (Big Sur) builds, replace with macOS 12 (Monterey) Jun 17, 2024
@jameslamb jameslamb changed the title WIP: [ci] drop macOS 11 (Big Sur) builds, replace with macOS 12 (Monterey) [ci] [python-package] run macOS x86_64 tests on macOS 12 (Monterey), stop manually setting macOS wheel tags Jun 17, 2024
@jameslamb jameslamb marked this pull request as ready for review June 17, 2024 03:39
@jameslamb jameslamb merged commit 7cb1892 into master Jun 17, 2024
41 checks passed
@jameslamb jameslamb deleted the ci/mac-version branch June 17, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants