Unverified Commit 915c2706 authored by Oliver Borchert's avatar Oliver Borchert Committed by GitHub
Browse files

[ci] Drop support for Python 3.7 and Python 3.8 (#6896)



* [ci] Drop support for Python 3.7 and Python 3.8

* Fix

* Bump numpy

* Fix

* fix comment, revert unrelated quoting changes

* add docs

---------
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
Co-authored-by: default avatarJames Lamb <jaylamb20@gmail.com>
parent 2a5e33b7
...@@ -3,7 +3,7 @@ version: 4.6.0.99.{build} ...@@ -3,7 +3,7 @@ version: 4.6.0.99.{build}
image: Visual Studio 2015 image: Visual Studio 2015
platform: x64 platform: x64
configuration: configuration:
- '3.8' - '3.9'
# only build on 'master' and pull requests targeting it # only build on 'master' and pull requests targeting it
branches: branches:
......
# [description]
#
# Similar to ci-core.txt, but specific to Python 3.8.
#
# Unlike ci-core.txt, this includes a Python version and uses
# `=` and `<=` pins to make solves faster and prevent against
# issues like https://github.com/microsoft/LightGBM/pull/6370.
#
# [usage]
#
# conda create \
# --name test-env \
# --file ./.ci/conda-envs/ci-core-py38.txt
#
# python
python=3.8.*
# direct imports
cffi=1.15.*
dask=2023.5.*
distributed=2023.5.*
joblib=1.4.*
matplotlib-base=3.7.*
numpy=1.24.*
pandas=1.5.*
pyarrow-core=16.1.*
python-graphviz=0.20.*
scikit-learn=1.3.*
scipy=1.10.*
# testing-only dependencies
cloudpickle=3.0.*
pluggy=1.5.*
psutil=5.9.8
pytest=8.2.*
# other recursive dependencies, just
# pinned here to help speed up solves
bokeh=3.1.*
fsspec=2024.5.*
# pinning 'libabseil' and 'libre2' to specific build numbers for pyarrow compatibility:
# ref: https://github.com/microsoft/LightGBM/issues/6772
libabseil=20240722.0=*_1
libre2-11=2024.07.02=*_1
msgpack-python=1.0.*
pluggy=1.5.*
pyparsing=3.1.4
pytz=2024.1
setuptools=69.5.*
snappy=1.2.*
tomli=2.0.*
tornado=6.4.*
wheel=0.43.*
zict=3.0.*
zipp=3.17.*
# [description] # [description]
# #
# Similar to ci-core.txt, but specific to Python 3.7. # Similar to ci-core.txt, but specific to Python 3.9.
# #
# Unlike ci-core.txt, this includes a Python version and uses # Unlike ci-core.txt, this includes a Python version and uses
# `=` and `<=` pins to make solves faster and prevent against # `=` and `<=` pins to make solves faster and prevent against
...@@ -10,27 +10,24 @@ ...@@ -10,27 +10,24 @@
# #
# conda create \ # conda create \
# --name test-env \ # --name test-env \
# --file ./.ci/conda-envs/ci-core-py37.txt # --file ./.ci/conda-envs/ci-core-py39.txt
# #
# python # python
python=3.7.* python=3.9.*
# direct imports # direct imports
cffi=1.15.* cffi=1.15.*
# older versions of Dask are incompatible with pandas>=2.0, but not all conda packages' metadata accurately reflects that # dask and distributed versions below are the first versions that support tornado >=6.2
# # which is required for testing
# ref: https://github.com/microsoft/LightGBM/issues/6030 dask=2022.12.*
dask=2022.2.* distributed=2022.12.*
distributed=2022.2.*
joblib=1.3.* joblib=1.3.*
matplotlib-base=3.5.* matplotlib-base=3.5.*
numpy=1.21.* numpy=1.22.*
pandas=1.3.* pandas=1.3.*
pyarrow=9.0.* pyarrow=9.0.*
# python-graphviz 0.20.2 is not compatible with Python 3.7 python-graphviz=0.20.*
# ref: https://github.com/microsoft/LightGBM/pull/6370
python-graphviz=0.20.1
scikit-learn=1.0.* scikit-learn=1.0.*
scipy=1.7.* scipy=1.7.*
...@@ -45,12 +42,11 @@ pytest=7.4.* ...@@ -45,12 +42,11 @@ pytest=7.4.*
bokeh=2.4.* bokeh=2.4.*
fsspec=2023.1.* fsspec=2023.1.*
msgpack-python=1.0.* msgpack-python=1.0.*
pluggy=1.0.*
pytz=2024.1 pytz=2024.1
setuptools=59.8.* setuptools=59.8.*
snappy=1.1.* snappy=1.1.*
tomli=2.0.* tomli=2.0.*
tornado=6.1.* tornado=6.2.*
wheel=0.42.* wheel=0.42.*
zict=2.2.* zict=2.2.*
zipp=3.15.* zipp=3.15.*
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# see https://devguide.python.org/versions/ # see https://devguide.python.org/versions/
# #
cffi==1.15.1 cffi==1.15.1
numpy==1.19.0 numpy==1.19.3
pandas==1.1.3 pandas==1.1.3
pyarrow==6.0.1 pyarrow==6.0.1
scikit-learn==0.24.2 scikit-learn==0.24.2
......
...@@ -68,10 +68,8 @@ conda activate ...@@ -68,10 +68,8 @@ conda activate
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q -y conda "python=$env:PYTHON_VERSION[build=*_cp*]" conda update -q -y conda "python=$env:PYTHON_VERSION[build=*_cp*]"
if ($env:PYTHON_VERSION -eq "3.7") { if ($env:PYTHON_VERSION -eq "3.9") {
$env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core-py37.txt" $env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core-py39.txt"
} elseif ($env:PYTHON_VERSION -eq "3.8") {
$env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core-py38.txt"
} else { } else {
$env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core.txt" $env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core.txt"
} }
......
...@@ -160,10 +160,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then ...@@ -160,10 +160,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
exit 0 exit 0
fi fi
if [[ $PYTHON_VERSION == "3.7" ]]; then if [[ $PYTHON_VERSION == "3.9" ]]; then
CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core-py37.txt" CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core-py39.txt"
elif [[ $PYTHON_VERSION == "3.8" ]]; then
CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core-py38.txt"
else else
CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core.txt" CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core.txt"
fi fi
......
...@@ -165,10 +165,10 @@ jobs: ...@@ -165,10 +165,10 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
# end-of-life Python versions # This should always include at least the oldest
# not-yet-end-of-life Python version
python_version: python_version:
- '3.7' - '3.9'
- '3.8'
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
......
...@@ -333,6 +333,12 @@ Examples ...@@ -333,6 +333,12 @@ Examples
Refer to the walk through examples in `Python guide folder <https://github.com/microsoft/LightGBM/tree/master/examples/python-guide>`_. Refer to the walk through examples in `Python guide folder <https://github.com/microsoft/LightGBM/tree/master/examples/python-guide>`_.
Supported Python Versions
-------------------------
This project supports all Python versions until they reach end-of-life.
For details on the support calendar for Python versions, see https://devguide.python.org/versions/.
Development Guide Development Guide
----------------- -----------------
......
...@@ -10,8 +10,6 @@ classifiers = [ ...@@ -10,8 +10,6 @@ classifiers = [
"Operating System :: POSIX", "Operating System :: POSIX",
"Operating System :: Unix", "Operating System :: Unix",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
...@@ -30,7 +28,7 @@ maintainers = [ ...@@ -30,7 +28,7 @@ maintainers = [
] ]
name = "lightgbm" name = "lightgbm"
readme = "README.rst" readme = "README.rst"
requires-python = ">=3.7" requires-python = ">=3.9"
version = "4.6.0.99" version = "4.6.0.99"
[project.optional-dependencies] [project.optional-dependencies]
...@@ -103,7 +101,7 @@ exclude = [ ...@@ -103,7 +101,7 @@ exclude = [
line-length = 120 line-length = 120
# this should be set to the oldest version of python LightGBM supports # this should be set to the oldest version of python LightGBM supports
target-version = "py37" target-version = "py39"
[tool.ruff.format] [tool.ruff.format]
docstring-code-format = false docstring-code-format = false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment