Aluode/PerceptionLabPortable
0
1"""All minimum dependencies for scikit-learn."""
2
3# Authors: The scikit-learn developers
4# SPDX-License-Identifier: BSD-3-Clause
5
6import argparse
7from collections import defaultdict
8
9# scipy and cython should by in sync with pyproject.toml
10NUMPY_MIN_VERSION = "1.22.0"
11SCIPY_MIN_VERSION = "1.8.0"
12JOBLIB_MIN_VERSION = "1.2.0"
13THREADPOOLCTL_MIN_VERSION = "3.1.0"
14PYTEST_MIN_VERSION = "7.1.2"
15CYTHON_MIN_VERSION = "3.0.10"
16
17
18# 'build' and 'install' is included to have structured metadata for CI.
19# It will NOT be included in setup's extras_require
20# The values are (version_spec, comma separated tags)
21dependent_packages = {
22 "numpy": (NUMPY_MIN_VERSION, "build, install"),
23 "scipy": (SCIPY_MIN_VERSION, "build, install"),
24 "joblib": (JOBLIB_MIN_VERSION, "install"),
25 "threadpoolctl": (THREADPOOLCTL_MIN_VERSION, "install"),
26 "cython": (CYTHON_MIN_VERSION, "build"),
27 "meson-python": ("0.17.1", "build"),
28 "matplotlib": ("3.5.0", "benchmark, docs, examples, tests"),
29 "scikit-image": ("0.19.0", "docs, examples, tests"),
30 "pandas": ("1.4.0", "benchmark, docs, examples, tests"),
31 "seaborn": ("0.9.0", "docs, examples"),
32 "memory_profiler": ("0.57.0", "benchmark, docs"),
33 "pytest": (PYTEST_MIN_VERSION, "tests"),
34 "pytest-cov": ("2.9.0", "tests"),
35 "ruff": ("0.11.7", "tests"),
36 "mypy": ("1.15", "tests"),
37 "pyamg": ("4.2.1", "tests"),
38 "polars": ("0.20.30", "docs, tests"),
39 "pyarrow": ("12.0.0", "tests"),
40 "sphinx": ("7.3.7", "docs"),
41 "sphinx-copybutton": ("0.5.2", "docs"),
42 "sphinx-gallery": ("0.17.1", "docs"),
43 "numpydoc": ("1.2.0", "docs, tests"),
44 "Pillow": ("8.4.0", "docs"),
45 "pooch": ("1.6.0", "docs, examples, tests"),
46 "sphinx-prompt": ("1.4.0", "docs"),
47 "sphinxext-opengraph": ("0.9.1", "docs"),
48 "plotly": ("5.14.0", "docs, examples"),
49 "sphinxcontrib-sass": ("0.3.4", "docs"),
50 "sphinx-remove-toctrees": ("1.0.0.post1", "docs"),
51 "sphinx-design": ("0.6.0", "docs"),
52 "pydata-sphinx-theme": ("0.15.3", "docs"),
53 "towncrier": ("24.8.0", "docs"),
54 # XXX: Pin conda-lock to the latest released version (needs manual update
55 # from time to time)
56 "conda-lock": ("3.0.1", "maintenance"),
57}
58
59
60# create inverse mapping for setuptools
61tag_to_packages: dict = defaultdict(list)
62for package, (min_version, extras) in dependent_packages.items():
63 for extra in extras.split(", "):
64 tag_to_packages[extra].append("{}>={}".format(package, min_version))
65
66
67# Used by CI to get the min dependencies
68if __name__ == "__main__":
69 parser = argparse.ArgumentParser(description="Get min dependencies for a package")
70
71 parser.add_argument("package", choices=dependent_packages)
72 args = parser.parse_args()
73 min_version = dependent_packages[args.package][0]
74 print(min_version)
75 