Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MNT Drops Python 3.7 in CI, wheel building, and docs #22617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ version: 2.1
jobs:
doc-min-dependencies:
docker:
- image: circleci/python:3.7.7-buster
- image: cimg/python:3.8.12
environment:
- OMP_NUM_THREADS: 2
- MKL_NUM_THREADS: 2
- CONDA_ENV_NAME: testenv
- PYTHON_VERSION: 3.7
- PYTHON_VERSION: 3.8
- NUMPY_VERSION: 'min'
- SCIPY_VERSION: 'min'
- MATPLOTLIB_VERSION: 'min'
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

doc:
docker:
- image: circleci/python:3.7.7-buster
- image: cimg/python:3.8.12
environment:
- OMP_NUM_THREADS: 2
- MKL_NUM_THREADS: 2
Expand Down Expand Up @@ -100,13 +100,13 @@ jobs:

lint:
docker:
- image: circleci/python:3.7
- image: cimg/python:3.8.12
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
- run:
name: dependencies
command: sudo pip install flake8
command: pip install flake8
- run:
name: linting
command: ./build_tools/circle/linting.sh
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- ~/scikit_learn_data
deploy:
docker:
- image: circleci/python:3.7
- image: cimg/python:3.8.12
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
Expand Down
24 changes: 1 addition & 23 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
name: Check build trigger
run: bash build_tools/github/check_build_trigger.sh

# Build the wheels for Linux, Windows and macOS for Python 3.7 and newer
# Build the wheels for Linux, Windows and macOS for Python 3.8 and newer
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
runs-on: ${{ matrix.os }}
Expand All @@ -51,10 +51,6 @@ jobs:
# Window 64 bit
# Note: windows-2019 is needed for older Python versions:
# https://github.com/scikit-learn/scikit-learn/issues/22530
- os: windows-2019
python: 37
bitness: 64
platform_id: win_amd64
- os: windows-2019
python: 38
bitness: 64
Expand All @@ -69,10 +65,6 @@ jobs:
platform_id: win_amd64

# Window 32 bit
- os: windows-latest
python: 37
bitness: 32
platform_id: win32
- os: windows-latest
python: 38
bitness: 32
Expand All @@ -83,11 +75,6 @@ jobs:
platform_id: win32

# Linux 64 bit manylinux2014
- os: ubuntu-latest
python: 37
bitness: 64
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: 38
bitness: 64
Expand All @@ -100,11 +87,6 @@ jobs:
manylinux_image: manylinux2014

# Linux 64 bit manylinux2010
- os: ubuntu-latest
python: 37
bitness: 64
platform_id: manylinux_x86_64
manylinux_image: manylinux2010
- os: ubuntu-latest
python: 38
bitness: 64
Expand All @@ -124,10 +106,6 @@ jobs:
manylinux_image: manylinux2014

# MacOS x86_64
- os: macos-latest
bitness: 64
python: 37
platform_id: macosx_x86_64
- os: macos-latest
bitness: 64
python: 38
Expand Down
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,11 @@ env:
jobs:
include:
# Linux environments to build the scikit-learn wheels for the ARM64
# architecture and Python 3.7 and newer. This is used both at release time
# architecture and Python 3.8 and newer. This is used both at release time
# with the manual trigger in the commit message in the release branch and as
# a scheduled task to build the weekly dev build on the main branch. The
# weekly frequency is meant to avoid depleting the Travis CI credits too
# fast.
- os: linux
arch: arm64-graviton2
dist: focal
virt: vm
group: edge
if: type = cron or commit_message =~ /\[cd build\]/
env:
- CIBW_BUILD=cp37-manylinux_aarch64
- BUILD_WHEEL=true

- os: linux
arch: arm64-graviton2
dist: focal
Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/workflows/Wheel%20builder/badge.svg?event=schedule
.. _`Nightly wheels`: https://github.com/scikit-learn/scikit-learn/actions?query=workflow%3A%22Wheel+builder%22+event%3Aschedule

.. |PythonVersion| image:: https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue
.. |PythonVersion| image:: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue
.. _PythonVersion: https://pypi.org/project/scikit-learn/

.. |PyPi| image:: https://img.shields.io/pypi/v/scikit-learn
Expand All @@ -32,14 +32,14 @@
.. |Benchmark| image:: https://img.shields.io/badge/Benchmarked%20by-asv-blue
.. _`Benchmark`: https://scikit-learn.org/scikit-learn-benchmarks/

.. |PythonMinVersion| replace:: 3.7
.. |NumPyMinVersion| replace:: 1.14.6
.. |SciPyMinVersion| replace:: 1.1.0
.. |PythonMinVersion| replace:: 3.8
.. |NumPyMinVersion| replace:: 1.16.6
.. |SciPyMinVersion| replace:: 1.3.2
.. |JoblibMinVersion| replace:: 1.0.0
.. |ThreadpoolctlMinVersion| replace:: 2.0.0
.. |MatplotlibMinVersion| replace:: 2.2.3
.. |MatplotlibMinVersion| replace:: 3.1.2
.. |Scikit-ImageMinVersion| replace:: 0.14.5
.. |PandasMinVersion| replace:: 0.25.0
.. |PandasMinVersion| replace:: 1.0.5
.. |SeabornMinVersion| replace:: 0.9.0
.. |PytestMinVersion| replace:: 5.0.1

Expand Down Expand Up @@ -75,8 +75,8 @@ scikit-learn requires:
=======

**Scikit-learn 0.20 was the last version to support Python 2.7 and Python 3.4.**
scikit-learn 0.23 and later require Python 3.6 or newer.
scikit-learn 1.0 and later require Python 3.7 or newer.
scikit-learn 1.1 and later require Python 3.8 or newer.

Scikit-learn plotting capabilities (i.e., functions start with ``plot_`` and
classes end with "Display") require Matplotlib (>= |MatplotlibMinVersion|).
Expand Down
20 changes: 10 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ jobs:
ne(variables['Build.Reason'], 'Schedule')
)
matrix:
py37_conda_forge_openblas_ubuntu_1804:
py38_conda_forge_openblas_ubuntu_1804:
DISTRIB: 'conda'
CONDA_CHANNEL: 'conda-forge'
PYTHON_VERSION: '3.7'
PYTHON_VERSION: '3.8'
BLAS: 'openblas'
COVERAGE: 'false'
BUILD_WITH_ICC: 'false'
Expand All @@ -190,11 +190,11 @@ jobs:
PANDAS_VERSION: 'none'
THREADPOOLCTL_VERSION: 'min'
COVERAGE: 'false'
# Linux + Python 3.7 build with OpenBLAS
py37_conda_defaults_openblas:
# Linux + Python 3.8 build with OpenBLAS
py38_conda_defaults_openblas:
DISTRIB: 'conda'
CONDA_CHANNEL: 'defaults' # Anaconda main channel
PYTHON_VERSION: '3.7'
PYTHON_VERSION: '3.8'
BLAS: 'openblas'
NUMPY_VERSION: 'min'
SCIPY_VERSION: 'min'
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
matrix:
debian_atlas_32bit:
DISTRIB: 'debian-32'
DOCKER_CONTAINER: 'i386/debian:10.9'
DOCKER_CONTAINER: 'i386/debian:11.2'
JOBLIB_VERSION: 'min'
# disable pytest xdist due to unknown bug with 32-bit container
PYTEST_XDIST_VERSION: 'none'
Expand Down Expand Up @@ -268,10 +268,10 @@ jobs:
ne(variables['Build.Reason'], 'Schedule')
)
matrix:
py37_conda_forge_mkl:
py38_conda_forge_mkl:
DISTRIB: 'conda'
CONDA_CHANNEL: 'conda-forge'
PYTHON_VERSION: '3.7'
PYTHON_VERSION: '3.8'
CHECK_WARNINGS: 'true'
PYTHON_ARCH: '64'
# Unpin when pytest stalling issue is fixed
Expand All @@ -280,6 +280,6 @@ jobs:
# Temporary fix for setuptools to use disutils from standard lib
# https://github.com/numpy/numpy/issues/17216
SETUPTOOLS_USE_DISTUTILS: 'stdlib'
py37_pip_openblas_32bit:
PYTHON_VERSION: '3.7'
py38_pip_openblas_32bit:
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '32'
5 changes: 0 additions & 5 deletions build_tools/circle/build_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@ mamba create -n $CONDA_ENV_NAME --yes --quiet \
compilers

source activate testenv
# Pin PyWavelet to 1.1.1 that is the latest version that support our minumum
# NumPy version required. If PyWavelets 1.2+ is installed, it would require
# NumPy 1.17+ that trigger a bug with Pandas 0.25:
# https://github.com/numpy/numpy/issues/18355#issuecomment-774610226
pip install PyWavelets==1.1.1
pip install "$(get_dep scikit-image $SCIKIT_IMAGE_VERSION)"
pip install "$(get_dep sphinx-gallery $SPHINX_GALLERY_VERSION)"
pip install "$(get_dep numpydoc $NUMPYDOC_VERSION)"
Expand Down
9 changes: 2 additions & 7 deletions doc/developers/advanced_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ feature, code or documentation improvement).
conda activate sklearn-env

#. **Alternative to conda:** If you run Linux or similar, you can instead use
your system's Python provided it is recent enough (3.7 or higher
your system's Python provided it is recent enough (3.8 or higher
at the time of writing). In this case, we recommend to create a dedicated
virtualenv_ and install the scikit-learn build dependencies with pip:

Expand Down Expand Up @@ -114,17 +114,12 @@ Runtime dependencies
Scikit-learn requires the following dependencies both at build time and at
runtime:

- Python (>= 3.7),
- Python (>= 3.8),
- NumPy (>= |NumpyMinVersion|),
- SciPy (>= |ScipyMinVersion|),
- Joblib (>= |JoblibMinVersion|),
- threadpoolctl (>= |ThreadpoolctlMinVersion|).

.. note::

For running on PyPy, PyPy3-v5.10+, Numpy 1.14.0+, and scipy 1.1.0+
are required. For PyPy, only installation instructions with pip apply.

Build dependencies
~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 7 additions & 4 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@ careful choice of algorithms.
Do you support PyPy?
--------------------

In case you didn't know, `PyPy <https://pypy.org/>`_ is an alternative
Python implementation with a built-in just-in-time compiler. Experimental
support for PyPy3-v5.10+ has been added, which requires Numpy 1.14.0+,
and scipy 1.1.0+.
scikit-learn is regularly tested and maintained to work with
`PyPy <https://pypy.org/>`_ (an alternative Python implementation with
a built-in just-in-time compiler).

Note however that this support is still considered experimental and specific
components might behave slightly differently. Please refer to the test
suite of a the specific module of interest for more details.

How do I deal with string data (or trees, graphs...)?
-----------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ purpose.
Scikit-learn 0.21 supported Python 3.5-3.7.
Scikit-learn 0.22 supported Python 3.5-3.8.
Scikit-learn 0.23 - 0.24 require Python 3.6 or newer.
Scikit-learn 1.0 and later requires Python 3.7 or newer.
Scikit-learn 1.0 supported Python 3.7-3.10.
Scikit-learn 1.1 and later requires Python 3.8 or newer.


.. note::
Expand Down
4 changes: 2 additions & 2 deletions doc/whats_new/v1.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Version 1.1.0
Minimal dependencies
--------------------

Version 1.1.0 of scikit-learn requires python 3.7+, numpy 1.14.6+ and
scipy 1.1.0+. Optional minimal dependency is matplotlib 2.2.3+.
Version 1.1.0 of scikit-learn requires python 3.8+, numpy 1.16.6+ and
scipy 1.3.2+. Optional minimal dependency is matplotlib 3.1.2+.

Put the changes in their relevant module.

Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ requires = [
# wheels on PyPI
#
# see: https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg
"oldest-supported-numpy; python_version!='3.7' or platform_machine=='aarch64' or platform_system=='AIX' or platform_python_implementation == 'PyPy'",
"oldest-supported-numpy",

# Override oldest-supported-numpy setting because pandas 0.25.0 requires 1.14.6
"numpy==1.14.6; python_version=='3.7' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation != 'PyPy'",

"scipy>=1.1.0",
"scipy>=1.3.2",
]

[tool.black]
Expand Down
24 changes: 17 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
try:
import builtins
except ImportError:
# Python 2 compat: just to be able to declare that Python >=3.7 is needed.
# Python 2 compat: just to be able to declare that Python >=3.8 is needed.
import __builtin__ as builtins

# This is a bit (!) hackish: we are setting a global variable so that the
Expand Down Expand Up @@ -156,7 +156,7 @@ def build_extensions(self):

except ImportError:
# Numpy should not be a dependency just to be able to introspect
# that python 3.7 is required.
# that python 3.8 is required.
pass


Expand Down Expand Up @@ -230,6 +230,16 @@ def check_package_status(package, min_version):


def setup_package():

# TODO: Require Python 3.8 for PyPy when PyPy3.8 is ready
# https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/2089
if platform.python_implementation() == "PyPy":
python_requires = ">=3.7"
required_python_version = (3, 7)
else:
python_requires = ">=3.8"
required_python_version = (3, 8)

metadata = dict(
name=DISTNAME,
maintainer=MAINTAINER,
Expand All @@ -255,15 +265,14 @@ def setup_package():
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
cmdclass=cmdclass,
python_requires=">=3.7",
python_requires=python_requires,
install_requires=min_deps.tag_to_packages["install"],
package_data={"": ["*.pxd"]},
**extra_setuptools_args,
Expand All @@ -282,11 +291,12 @@ def setup_package():

metadata["version"] = VERSION
else:
if sys.version_info < (3, 6):
if sys.version_info < required_python_version:
required_version = "%d.%d" % required_python_version
raise RuntimeError(
"Scikit-learn requires Python 3.7 or later. The current"
"Scikit-learn requires Python %s or later. The current"
" Python version is %s installed in %s."
% (platform.python_version(), sys.executable)
% (required_version, platform.python_version(), sys.executable)
)

check_package_status("numpy", min_deps.NUMPY_MIN_VERSION)
Expand Down
Loading