@@ -14,9 +14,13 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17- python-sdist-test-on-Linux :
18- runs-on : ubuntu-latest
19- name : Test installing XGBoost Python source package
17+ python-sdist-test :
18+ runs-on : ${{ matrix.os }}
19+ name : Test installing Python XGBoost from the source distribution (${{ matrix.os }})
20+ strategy :
21+ fail-fast : false
22+ matrix :
23+ os : [macos-13, windows-latest, ubuntu-latest]
2024 steps :
2125 - uses : actions/checkout@v4
2226 with :
@@ -32,53 +36,12 @@ jobs:
3236 run : |
3337 conda info
3438 conda list
35- - name : Build and install XGBoost
39+ - name : Install extra package for MacOS
3640 run : |
37- cd python-package
38- python --version
39- python -m build --sdist
40- pip install -v ./dist/xgboost-*.tar.gz --config-settings use_openmp=False
41- cd ..
42- python -c 'import xgboost'
43-
44- python-sdist-test :
45- # Use system toolchain instead of conda toolchain for macos and windows.
46- # MacOS has linker error if clang++ from conda-forge is used
47- runs-on : ${{ matrix.os }}
48- name : Test installing XGBoost Python source package on ${{ matrix.os }}
49- strategy :
50- fail-fast : false
51- matrix :
52- os : [macos-13, windows-latest]
53- python-version : ["3.10"]
54- steps :
55- - uses : actions/checkout@v4
56- with :
57- submodules : ' true'
58- - name : Install osx system dependencies
41+ mamba install -c conda-forge llvm-openmp
5942 if : matrix.os == 'macos-13'
60- run : |
61- brew install ninja libomp
62- - uses : conda-incubator/setup-miniconda@v3
63- with :
64- auto-update-conda : true
65- python-version : ${{ matrix.python-version }}
66- activate-environment : test
67- - name : Install build
68- run : |
69- conda install -c conda-forge python-build
70- - name : Display Conda env
71- run : |
72- conda info
73- conda list
7443 - name : Build and install XGBoost
75- run : |
76- cd python-package
77- python --version
78- python -m build --sdist
79- pip install -v ./dist/xgboost-*.tar.gz
80- cd ..
81- python -c 'import xgboost'
44+ run : bash ops/pipeline/test-python-sdist.sh
8245
8346 python-tests-on-macos :
8447 name : Test XGBoost Python package on macos-13
@@ -102,31 +65,7 @@ jobs:
10265 conda info
10366 conda list
10467
105- - name : Build XGBoost on macos
106- run : |
107- brew install ninja
108-
109- mkdir build
110- cd build
111- # Set prefix, to use OpenMP library from Conda env
112- # See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228
113- # to learn why we don't use libomp from Homebrew.
114- cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_DEPRECATED_CLI=ON
115- ninja
116-
117- - name : Install Python package
118- run : |
119- cd python-package
120- python --version
121- pip install -v .
122-
123- - name : Test Python package
124- run : |
125- pytest -s -v -rxXs --durations=0 ./tests/python
126-
127- - name : Test Dask Interface
128- run : |
129- pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_dask
68+ - run : bash ops/pipeline/test-python-macos.sh
13069
13170 python-system-installation-on-ubuntu :
13271 name : Test XGBoost Python package System Installation on Ubuntu
@@ -135,32 +74,8 @@ jobs:
13574 - uses : actions/checkout@v4
13675 with :
13776 submodules : ' true'
138-
13977 - name : Set up Python 3.10
14078 uses : actions/setup-python@v5
14179 with :
14280 python-version : " 3.10"
143-
144- - name : Install ninja
145- run : |
146- sudo apt-get update && sudo apt-get install -y ninja-build
147-
148- - name : Build XGBoost on Ubuntu
149- run : |
150- mkdir build
151- cd build
152- cmake .. -GNinja
153- ninja
154-
155- - name : Copy lib to system lib
156- run : |
157- cp lib/* "$(python -c 'import sys; print(sys.base_prefix)')/lib"
158-
159- - name : Install XGBoost in Virtual Environment
160- run : |
161- cd python-package
162- pip install virtualenv
163- virtualenv venv
164- source venv/bin/activate && \
165- pip install -v . --config-settings use_system_libxgboost=True && \
166- python -c 'import xgboost'
81+ - run : bash ops/pipeline/test-python-with-sysprefix.sh
0 commit comments