From dae7a41baa8305597843ddab1219170124172663 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Thu, 14 Jul 2022 18:01:47 +0800 Subject: [PATCH] Update Python requirement to >=3.8. (#8071) Additional changes: - Use mamba for CPU test on Jenkins. - Cleanup CPU test dependencies. - Restore some of the modin tests --- .github/workflows/main.yml | 8 +++---- .github/workflows/python_wheels.yml | 2 +- .github/workflows/r_tests.yml | 2 +- python-package/setup.py | 3 +-- tests/ci_build/Dockerfile.cpu | 6 +++--- tests/ci_build/build_python_wheels.sh | 2 +- tests/ci_build/conda_env/aarch64_test.yml | 2 +- tests/ci_build/conda_env/cpu_test.yml | 24 ++++++++------------- tests/ci_build/conda_env/macos_cpu_test.yml | 2 +- tests/python/test_with_modin.py | 3 +-- 10 files changed, 23 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7821a6e9c..4fc11f22c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -136,7 +136,7 @@ jobs: submodules: 'true' - uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: "3.8" architecture: 'x64' - name: Install Python packages run: | @@ -155,7 +155,7 @@ jobs: submodules: 'true' - uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: "3.8" architecture: 'x64' - name: Install Python packages run: | @@ -173,7 +173,7 @@ jobs: submodules: 'true' - uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: "3.8" architecture: 'x64' - name: Install system packages run: | @@ -210,7 +210,7 @@ jobs: submodules: 'true' - uses: actions/setup-python@v2 with: - python-version: '3.8' + python-version: "3.8" architecture: 'x64' - name: Install system packages run: | diff --git a/.github/workflows/python_wheels.yml b/.github/workflows/python_wheels.yml index 152aaf168..c225a9141 100644 --- a/.github/workflows/python_wheels.yml +++ b/.github/workflows/python_wheels.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: '3.9' + python-version: "3.8" - name: Build wheels run: bash tests/ci_build/build_python_wheels.sh ${{ matrix.platform_id }} ${{ github.sha }} - name: Extract branch name diff --git a/.github/workflows/r_tests.yml b/.github/workflows/r_tests.yml index 7e713a131..ebc220564 100644 --- a/.github/workflows/r_tests.yml +++ b/.github/workflows/r_tests.yml @@ -97,7 +97,7 @@ jobs: - uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: "3.8" architecture: 'x64' - name: Test R diff --git a/python-package/setup.py b/python-package/setup.py index 038c52618..725f82e05 100644 --- a/python-package/setup.py +++ b/python-package/setup.py @@ -365,11 +365,10 @@ if __name__ == '__main__': 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10'], - python_requires=">=3.7", + python_requires=">=3.8", url='https://github.com/dmlc/xgboost') clean_up() diff --git a/tests/ci_build/Dockerfile.cpu b/tests/ci_build/Dockerfile.cpu index 252801835..4210f63f0 100644 --- a/tests/ci_build/Dockerfile.cpu +++ b/tests/ci_build/Dockerfile.cpu @@ -15,8 +15,8 @@ RUN \ wget -nv -nc https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.sh --no-check-certificate && \ bash cmake-3.14.0-Linux-x86_64.sh --skip-license --prefix=/usr && \ # Python - wget -O Miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ - bash Miniconda3.sh -b -p /opt/python + wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh && \ + bash Mambaforge-Linux-x86_64.sh -b -p /opt/python ENV PATH=/opt/python/bin:$PATH ENV CC=gcc-8 @@ -28,7 +28,7 @@ ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ # Create new Conda environment COPY conda_env/cpu_test.yml /scripts/ -RUN conda env create -n cpu_test --file=/scripts/cpu_test.yml +RUN mamba env create -n cpu_test --file=/scripts/cpu_test.yml # Install lightweight sudo (not bound to TTY) RUN set -ex; \ diff --git a/tests/ci_build/build_python_wheels.sh b/tests/ci_build/build_python_wheels.sh index abe520708..d91df2286 100644 --- a/tests/ci_build/build_python_wheels.sh +++ b/tests/ci_build/build_python_wheels.sh @@ -34,7 +34,7 @@ if [[ "$platform_id" == macosx_* ]]; then elif [[ "$platform_id" == macosx_x86_64 ]]; then # MacOS, Intel wheel_tag=macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64 - cpython_ver=37 + cpython_ver=38 export MACOSX_DEPLOYMENT_TARGET=10.13 #OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-64/llvm-openmp-11.1.0-hda6cdc1_1.tar.bz2" OPENMP_URL="https://xgboost-ci-jenkins-artifacts.s3.us-west-2.amazonaws.com/llvm-openmp-11.1.0-hda6cdc1_1-osx-64.tar.bz2" diff --git a/tests/ci_build/conda_env/aarch64_test.yml b/tests/ci_build/conda_env/aarch64_test.yml index 7c6228a8d..fe30eced1 100644 --- a/tests/ci_build/conda_env/aarch64_test.yml +++ b/tests/ci_build/conda_env/aarch64_test.yml @@ -2,7 +2,7 @@ name: aarch64_test channels: - conda-forge dependencies: -- python=3.7 +- python=3.8 - pip - wheel - pytest diff --git a/tests/ci_build/conda_env/cpu_test.yml b/tests/ci_build/conda_env/cpu_test.yml index 13b92e49b..e5ea8e285 100644 --- a/tests/ci_build/conda_env/cpu_test.yml +++ b/tests/ci_build/conda_env/cpu_test.yml @@ -1,8 +1,9 @@ name: cpu_test channels: +- defaults - conda-forge dependencies: -- python=3.7 +- python=3.8 - pip - wheel - pyyaml @@ -13,16 +14,13 @@ dependencies: - scikit-learn - pandas - matplotlib -- dask -- distributed +- dask>=2022.6 +- distributed>=2022.6 - python-graphviz -- hypothesis +- hypothesis>=6.46 - astroid -- sphinx - sh -- recommonmark - mock -- breathe - pytest - pytest-cov - python-kubernetes @@ -30,17 +28,13 @@ dependencies: - jsonschema - boto3 - awscli -- numba -- llvmlite - py-ubjson - cffi - pyarrow -- protobuf<=3.20 -- pyspark +- protobuf +- pyspark>=3.3.0 - cloudpickle +- shap +- modin - pip: - - shap - - ipython # required by shap at import time. - - sphinx_rtd_theme - datatable - - modin[all] diff --git a/tests/ci_build/conda_env/macos_cpu_test.yml b/tests/ci_build/conda_env/macos_cpu_test.yml index 0b30cc81b..11d82ff7b 100644 --- a/tests/ci_build/conda_env/macos_cpu_test.yml +++ b/tests/ci_build/conda_env/macos_cpu_test.yml @@ -2,7 +2,7 @@ name: macos_test channels: - conda-forge dependencies: -- python=3.7 +- python=3.8 - pip - wheel - pyyaml diff --git a/tests/python/test_with_modin.py b/tests/python/test_with_modin.py index e997202d1..0ed59d3f8 100644 --- a/tests/python/test_with_modin.py +++ b/tests/python/test_with_modin.py @@ -19,9 +19,8 @@ rng = np.random.RandomState(1994) class TestModin: - + @pytest.mark.xfail def test_modin(self): - df = md.DataFrame([[1, 2., True], [2, 3., False]], columns=['a', 'b', 'c']) dm = xgb.DMatrix(df, label=md.Series([1, 2]))