diff --git a/.ci/test-windows.ps1 b/.ci/test-windows.ps1 index 264c13961aff..d3bf9967b943 100644 --- a/.ci/test-windows.ps1 +++ b/.ci/test-windows.ps1 @@ -66,7 +66,7 @@ if ($env:TASK -eq "swig") { conda init powershell conda activate conda config --set always_yes yes --set changeps1 no -conda update -q -y conda "python=$env:PYTHON_VERSION[build=*cpython]" +conda update -q -y conda "python=$env:PYTHON_VERSION[build=*_cp*]" if ($env:PYTHON_VERSION -eq "3.7") { $env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core-py37.txt" @@ -80,7 +80,7 @@ $condaParams = @( "-y", "-n", "$env:CONDA_ENV", "--file", "$env:CONDA_REQUIREMENT_FILE", - "python=$env:PYTHON_VERSION[build=*cpython]" + "python=$env:PYTHON_VERSION[build=*_cp*]" ) conda create @condaParams ; Assert-Output $? diff --git a/.ci/test.sh b/.ci/test.sh index 82c159064a33..c4b749e18ca8 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -64,8 +64,9 @@ if [[ "$TASK" == "cpp-tests" ]]; then exit 0 fi -# including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy -CONDA_PYTHON_REQUIREMENT="python=${PYTHON_VERSION}[build=*cpython]" +# including python=version=[build=*_cp*] to ensure that conda prefers CPython and doesn't fall back to +# other implementations like pypy +CONDA_PYTHON_REQUIREMENT="python=${PYTHON_VERSION}[build=*_cp*]" if [[ $TASK == "if-else" ]]; then conda create -q -y -n "${CONDA_ENV}" "${CONDA_PYTHON_REQUIREMENT}" numpy diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 4535f42ad719..0a483b01e56c 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -81,19 +81,19 @@ jobs: include: - method: wheel compiler: gcc - python_version: "3.10" + python_version: "3.11" cuda_version: "12.6.1" linux_version: "ubuntu22.04" task: cuda - method: source compiler: gcc - python_version: "3.12" + python_version: "3.13" cuda_version: "12.2.2" linux_version: "ubuntu22.04" task: cuda - method: pip compiler: clang - python_version: "3.11" + python_version: "3.12" cuda_version: "11.8.0" linux_version: "ubuntu20.04" task: cuda diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 42391bb31da0..4f9dc6dfb559 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -10,7 +10,7 @@ on: env: COMPILER: gcc OS_NAME: 'linux' - PYTHON_VERSION: '3.12' + PYTHON_VERSION: '3.13' TASK: 'check-links' jobs: diff --git a/.github/workflows/python_package.yml b/.github/workflows/python_package.yml index 154baf67b7ee..d41e4c54632a 100644 --- a/.github/workflows/python_package.yml +++ b/.github/workflows/python_package.yml @@ -28,32 +28,32 @@ jobs: include: - os: macos-13 task: regular - python_version: '3.10' + python_version: '3.11' - os: macos-13 task: sdist - python_version: '3.11' + python_version: '3.12' - os: macos-13 task: bdist - python_version: '3.8' + python_version: '3.9' - os: macos-13 task: if-else - python_version: '3.9' + python_version: '3.10' - os: macos-14 task: bdist method: wheel - python_version: '3.10' + python_version: '3.11' - os: macos-13 task: mpi method: source - python_version: '3.11' + python_version: '3.12' - os: macos-13 task: mpi method: pip - python_version: '3.12' + python_version: '3.13' - os: macos-13 task: mpi method: wheel - python_version: '3.9' + python_version: '3.10' steps: - name: Checkout repository uses: actions/checkout@v4 @@ -113,12 +113,19 @@ jobs: --rm \ -v $(pwd):/opt/lgb-build \ -w /opt/lgb-build \ - python:3.12 \ + python:3.13 \ /bin/bash ./.ci/test-python-latest.sh - test-oldest-versions: + test-old-versions: name: Python - oldest supported versions (ubuntu-latest) runs-on: ubuntu-latest timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + # end-of-life Python versions + python_version: + - 3.7 + - 3.8 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -140,12 +147,12 @@ jobs: --rm \ -v $(pwd):/opt/lgb-build \ -w /opt/lgb-build \ - python:3.7 \ + python:${{ matrix.python_version }} \ /bin/bash ./.ci/test-python-oldest.sh all-python-package-jobs-successful: if: always() runs-on: ubuntu-latest - needs: [test, test-latest-versions, test-oldest-versions] + needs: [test, test-latest-versions, test-old-versions] steps: - name: Note that all tests succeeded uses: re-actors/alls-green@v1.2.2 diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 7c4352c31a1c..3cf579f0707e 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -19,7 +19,7 @@ env: COMPILER: 'gcc' MAKEFLAGS: '-j4' OS_NAME: 'linux' - PYTHON_VERSION: '3.12' + PYTHON_VERSION: '3.13' jobs: test: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 7d63476a0f79..c2002e77a96d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,8 +1,8 @@ version: 2 build: - os: "ubuntu-20.04" + os: "ubuntu-lts-latest" tools: - python: "miniconda3-4.7" + python: "mambaforge-latest" conda: environment: docs/env.yml formats: diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 99d8975c366b..048347372a9c 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -94,19 +94,19 @@ jobs: matrix: regular: TASK: regular - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.11' sdist: TASK: sdist - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.9' bdist: TASK: bdist - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' inference: TASK: if-else mpi_source: TASK: mpi METHOD: source - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' gpu_source: TASK: gpu METHOD: source @@ -159,7 +159,7 @@ jobs: TASK: sdist bdist: TASK: bdist - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.11' inference: TASK: if-else mpi_source: @@ -168,23 +168,23 @@ jobs: mpi_pip: TASK: mpi METHOD: pip - PYTHON_VERSION: '3.11' + PYTHON_VERSION: '3.12' mpi_wheel: TASK: mpi METHOD: wheel - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' gpu_source: TASK: gpu METHOD: source - PYTHON_VERSION: '3.11' + PYTHON_VERSION: '3.12' gpu_pip: TASK: gpu METHOD: pip - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.11' gpu_wheel: TASK: gpu METHOD: wheel - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' cpp_tests: TASK: cpp-tests METHOD: with-sanitizers @@ -293,10 +293,10 @@ jobs: matrix: regular: TASK: regular - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.11' sdist: TASK: sdist - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' bdist: TASK: bdist swig: @@ -341,10 +341,10 @@ jobs: matrix: regular: TASK: regular - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.11' sdist: TASK: sdist - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' bdist: TASK: bdist swig: diff --git a/docs/env.yml b/docs/env.yml index 5c9c3dd73853..b8ac5d9840f0 100644 --- a/docs/env.yml +++ b/docs/env.yml @@ -4,15 +4,15 @@ channels: - conda-forge dependencies: - breathe>=4.35 - - python=3.10 - - r-base=4.3.2 - - r-data.table=1.14.10 - - r-jsonlite=1.8.8 - - r-knitr=1.45 - - r-markdown=1.12 - - r-matrix=1.6_4 - - r-pkgdown=2.0.7 + - python=3.12 + - r-base>=4.3.3 + - r-data.table=1.16.4 + - r-jsonlite=1.8.9 + - r-knitr=1.49 + - r-markdown=1.13 + - r-matrix=1.6_5 + - r-pkgdown=2.1.1 - r-roxygen2=7.3.2 - - scikit-learn>=1.4.0 - - sphinx>=6.0 - - sphinx_rtd_theme>=2.0 + - scikit-learn>=1.6.1 + - sphinx>=8.1.3,<9 + - sphinx_rtd_theme>=3.0.1,<4 diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index 8fcc85814db5..1e93fc61f679 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -16,6 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Artificial Intelligence" ] dependencies = [