8000 MNT Centralize conda-lock version into min_dependencies.py (#23432) · scikit-learn/scikit-learn@ef4c26b · GitHub
[go: up one dir, main page]

Skip to content

Commit ef4c26b

Browse files
authored
MNT Centralize conda-lock version into min_dependencies.py (#23432)
1 parent 7443071 commit ef4c26b

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

build_tools/azure/install.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ pre_python_environment_install() {
7474
python_environment_install_and_activate() {
7575
if [[ "$DISTRIB" == "conda"* ]]; then
7676
conda update -n base conda -y
77-
# pin conda-lock to latest released version (needs manual update from time to time)
78-
conda install -c conda-forge conda-lock==1.0.5 -y
77+
conda install -c conda-forge "$(get_dep conda-lock min)" -y
7978
conda-lock install --name $VIRTUALENV $LOCK_FILE
8079
source activate $VIRTUALENV
8180

build_tools/azure/install_win.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ source build_tools/shared.sh
88

99
if [[ "$DISTRIB" == "conda" ]]; then
1010
conda update -n base conda -y
11-
# TODO: update conda-lock version from time to time
1211
conda install pip -y
13-
pip install conda-lock==1.0.5
12+
pip install "$(get_dep conda-lock min)"
1413
conda-lock install --name $VIRTUALENV $LOCK_FILE
1514
source activate $VIRTUALENV
1615
else

build_tools/circle/build_test_arm.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ set -x
66
UNAMESTR=`uname`
77
N_CORES=`nproc --all`
88

9+
# defines the get_dep and show_installed_libraries functions
10+
source build_tools/shared.sh
11+
912
setup_ccache() {
1013
echo "Setting up ccache"
1114
mkdir /tmp/ccache/
@@ -28,8 +31,7 @@ chmod +x mambaforge.sh && ./mambaforge.sh -b -p $MINICONDA_PATH
2831
export PATH=$MINICONDA_PATH/bin:$PATH
2932
mamba init --all --verbose
3033
mamba update --yes conda
31-
# TODO Update conda-lock version from time to time
32-
mamba install conda-lock=1.0.5 -y
34+
mamba install "$(get_dep conda-lock min)" -y
3335
conda-lock install --name $CONDA_ENV_NAME $LOCK_FILE
3436
source activate $CONDA_ENV_NAME
3537

build_tools/update_environments_and_lock_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
To run this script you need:
2626
- conda-lock. The version should match the one used in the CI in
27-
build_tools/azure/install.sh
27+
sklearn/_min_dependencies.py
2828
- pip-tools
2929
3030
"""

sklearn/_min_dependencies.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""All minimum dependencies for scikit-learn."""
2+
from collections import defaultdict
23
import platform
34
import argparse
45

@@ -46,14 +47,14 @@
4647
"Pillow": ("7.1.2", "docs"),
4748
"sphinx-prompt": ("1.3.0", "docs"),
4849
"sphinxext-opengraph": ("0.4.2", "docs"),
50+
# XXX: Pin conda-lock to the latest released version (needs manual update
51+
# from time to time)
52+
"conda-lock": ("1.0.5", "maintenance"),
4953
}
5054

5155

5256
# create inverse mapping for setuptools
53-
tag_to_packages: dict = {
54-
extra: []
55-
for extra in ["build", "install", "docs", "examples", "tests", "benchmark"]
56-
}
57+
tag_to_packages: dict = defaultdict(list)
5758
for package, (min_version, extras) in dependent_packages.items():
5859
for extra in extras.split(", "):
5960
tag_to_packages[extra].append("{}>={}".format(package, min_version))

0 commit comments

Comments
 (0)
0