Skip to content

DOC Fix Python min version in advanced installation docs #31081

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 3 commits into from
Mar 31, 2025
Merged
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
11 changes: 8 additions & 3 deletions doc/developers/advanced_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

.. include:: ../min_dependency_substitutions.rst

..
TODO Add |PythonMinVersion| to min_dependency_substitutions.rst one day.
Probably would need to change a bit sklearn/_min_dependencies.py since Python is not really a package ...
.. |PythonMinVersion| replace:: 3.10

==================================================
Installing the development version of scikit-learn
==================================================
Expand Down Expand Up @@ -58,7 +63,7 @@ feature, code or documentation improvement).
If you plan on submitting a pull-request, you should clone from your fork
instead.

#. Install a recent version of Python (3.9 or later at the time of writing) for
#. Install a recent version of Python (|PythonMinVersion| or later) for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|PythonMinVersion| is not defined because Python min version is not set in _min_dependencies. That's why it was hard coded. I don't know if there's a reason against setting python min version in _min_dependencies, maybe we could do it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I naively assumed PythonMinVersion would "just work" because it works inside README.rst and I thought there was an include somewhere that was doing the magic 😅 I'll take a closer look ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in README.rst it's defined line 32 .. |PythonMinVersion| replace:: 3.10. We can define it here as well to keep things simple.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I did it the easier way after looking a bit how this was all generated. Maybe I will do it on a rainy day 😅

instance using conda-forge_. Conda-forge provides a conda-based distribution of
Python and the most popular scientific libraries.

Expand All @@ -78,7 +83,7 @@ feature, code or documentation improvement).
conda activate sklearn-env

#. **Alternative to conda:** You can use alternative installations of Python
provided they are recent enough (3.9 or higher at the time of writing).
provided they are recent enough (|PythonMinVersion| or higher).
Here is an example of how to create a build environment for a Linux system's
Python. Build dependencies are installed with `pip` in a dedicated virtualenv_
to avoid disrupting other Python programs installed on the system:
Expand Down Expand Up @@ -134,7 +139,7 @@ Runtime dependencies
Scikit-learn requires the following dependencies both at build time and at
runtime:

- Python (>= 3.8),
- Python (>= |PythonMinVersion|),
- NumPy (>= |NumpyMinVersion|),
- SciPy (>= |ScipyMinVersion|),
- Joblib (>= |JoblibMinVersion|),
Expand Down