Skip to content

Commit 7cb1892

Browse files
authored
[ci] [python-package] run macOS x86_64 tests on macOS 12 (Monterey), stop manually setting macOS wheel tags (#6487)
1 parent d56a7a3 commit 7cb1892

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

.ci/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [[ $OS_NAME == "macos" ]]; then
1414
if [[ $COMPILER == "clang" ]]; then
1515
brew install libomp
1616
if [[ $AZURE == "true" ]]; then
17-
sudo xcode-select -s /Applications/Xcode_11.7.app/Contents/Developer || exit 1
17+
sudo xcode-select -s /Applications/Xcode_13.1.0.app/Contents/Developer || exit 1
1818
fi
1919
else # gcc
2020
# Check https://github.com/actions/runner-images/tree/main/images/macos for available

.ci/test.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
2929
export LC_ALL="en_US.UTF-8"
3030
fi
3131

32+
# Setting MACOSX_DEPLOYMENT_TARGET prevents CMake from building against too-new
33+
# macOS features, and helps tools like Python build tools determine the appropriate
34+
# wheel compatibility tags.
35+
#
36+
# ref:
37+
# * https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html
38+
# * https://github.com/scikit-build/scikit-build-core/blob/acb7d0346e4a05bcb47a4ea3939c705ab71e3145/src/scikit_build_core/builder/macos.py#L36
39+
if [[ $ARCH == "x86_64" ]]; then
40+
export MACOSX_DEPLOYMENT_TARGET=10.15
41+
else
42+
export MACOSX_DEPLOYMENT_TARGET=12.0
43+
fi
44+
3245
if [[ "${TASK}" == "r-package" ]] || [[ "${TASK}" == "r-rchk" ]]; then
3346
bash ${BUILD_DIRECTORY}/.ci/test_r_package.sh || exit 1
3447
exit 0
@@ -168,17 +181,6 @@ elif [[ $TASK == "bdist" ]]; then
168181
if [[ $OS_NAME == "macos" ]]; then
169182
cd $BUILD_DIRECTORY && sh ./build-python.sh bdist_wheel || exit 1
170183
sh $BUILD_DIRECTORY/.ci/check_python_dists.sh $BUILD_DIRECTORY/dist || exit 1
171-
mv \
172-
./dist/*.whl \
173-
./dist/tmp.whl || exit 1
174-
if [[ $ARCH == "x86_64" ]]; then
175-
PLATFORM="macosx_10_15_x86_64.macosx_11_6_x86_64.macosx_12_5_x86_64"
176-
else
177-
PLATFORM="macosx_14_0_arm64"
178-
fi
179-
mv \
180-
./dist/tmp.whl \
181-
dist/lightgbm-$LGB_VER-py3-none-$PLATFORM.whl || exit 1
182184
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
183185
cp dist/lightgbm-$LGB_VER-py3-none-macosx*.whl $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1
184186
fi

.vsts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254
OS_NAME: 'macos'
255255
PRODUCES_ARTIFACTS: 'true'
256256
pool:
257-
vmImage: 'macOS-11'
257+
vmImage: 'macOS-12'
258258
strategy:
259259
matrix:
260260
regular:

0 commit comments

Comments
 (0)