Skip to content

Commit fc33d30

Browse files
rthNicolasHug
authored andcommitted
MAINT Unvendor joblib (scikit-learn#13531)
1 parent 7243cc3 commit fc33d30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+61
-14071
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ scikit-learn requires:
5050
- Python (>= 3.5)
5151
- NumPy (>= 1.11.0)
5252
- SciPy (>= 0.17.0)
53+
- joblib (>= 0.11)
5354

5455
**Scikit-learn 0.20 was the last version to support Python2.7.**
5556
Scikit-learn 0.21 and later require Python 3.5 or newer.

azure-pipelines.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
py35_np_atlas:
1212
DISTRIB: 'ubuntu'
1313
PYTHON_VERSION: '3.5'
14-
SKLEARN_SITE_JOBLIB: '1'
1514
JOBLIB_VERSION: '0.11'
1615
SKLEARN_NO_OPENMP: 'True'
1716
# Linux + Python 3.5 build with OpenBLAS and without SITE_JOBLIB
@@ -23,10 +22,11 @@ jobs:
2322
SCIPY_VERSION: '0.17.0'
2423
CYTHON_VERSION: '*'
2524
PILLOW_VERSION: '4.0.0'
25+
# later version of joblib are not packaged in conda for Python 3.5
26+
JOBLIB_VERSION: '0.12.3'
2627
COVERAGE: 'true'
2728
# Linux environment to test the latest available dependencies and MKL.
2829
# It runs tests requiring pandas and PyAMG.
29-
# It also runs with the site joblib instead of the vendored copy of joblib.
3030
pylatest_conda:
3131
DISTRIB: 'conda'
3232
PYTHON_VERSION: '*'
@@ -41,7 +41,6 @@ jobs:
4141
COVERAGE: 'true'
4242
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
4343
TEST_DOCSTRINGS: 'true'
44-
SKLEARN_SITE_JOBLIB: '1'
4544
CHECK_WARNINGS: 'true'
4645

4746
- template: build_tools/azure/posix.yml

build_tools/azure/install.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ IF "%PYTHON_ARCH%"=="64" (
1111
call deactivate
1212
@rem Clean up any left-over from a previous build
1313
conda remove --all -q -y -n %VIRTUALENV%
14-
conda create -n %VIRTUALENV% -q -y python=%PYTHON_VERSION% numpy scipy cython pytest wheel pillow
14+
conda create -n %VIRTUALENV% -q -y python=%PYTHON_VERSION% numpy scipy cython pytest wheel pillow joblib
1515

1616
call activate %VIRTUALENV%
1717
) else (
18-
pip install numpy scipy cython pytest wheel pillow
18+
pip install numpy scipy cython pytest wheel pillow joblib
1919
)
2020
if "%COVERAGE%" == "true" (
2121
pip install coverage codecov pytest-cov

build_tools/azure/install.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ make_conda() {
2727
if [[ "$DISTRIB" == "conda" ]]; then
2828
TO_INSTALL="python=$PYTHON_VERSION pip pytest pytest-cov \
2929
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
30-
cython=$CYTHON_VERSION"
30+
cython=$CYTHON_VERSION joblib=$JOBLIB_VERSION"
3131

3232
if [[ "$INSTALL_MKL" == "true" ]]; then
3333
TO_INSTALL="$TO_INSTALL mkl"
@@ -47,10 +47,6 @@ if [[ "$DISTRIB" == "conda" ]]; then
4747
TO_INSTALL="$TO_INSTALL pillow=$PILLOW_VERSION"
4848
fi
4949

50-
if [[ -n "$JOBLIB_VERSION" ]]; then
51-
TO_INSTALL="$TO_INSTALL joblib=$JOBLIB_VERSION"
52-
fi
53-
5450
make_conda $TO_INSTALL
5551

5652
elif [[ "$DISTRIB" == "ubuntu" ]]; then

build_tools/travis/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ elif [[ "$DISTRIB" == "scipy-dev" ]]; then
113113
pip install --pre --upgrade --timeout=60 -f $dev_url numpy scipy pandas cython
114114
echo "Installing joblib master"
115115
pip install https://github.com/joblib/joblib/archive/master.zip
116-
export SKLEARN_SITE_JOBLIB=1
117116
echo "Installing pillow master"
118117
pip install https://github.com/python-pillow/Pillow/archive/master.zip
119118
pip install pytest pytest-cov

conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,13 @@ def pytest_collection_modifyitems(config, items):
6161
for item in items:
6262
if isinstance(item, DoctestItem):
6363
item.add_marker(skip_marker)
64+
65+
66+
def pytest_configure(config):
67+
import sys
68+
sys._is_pytest_session = True
69+
70+
71+
def pytest_unconfigure(config):
72+
import sys
73+
del sys._is_pytest_session

doc/modules/computing.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ These environment variables should be set before importing scikit-learn.
553553
is supported. In addition, dumps from joblib.Memory might be incompatible,
554554
and you might loose some caches and have to redownload some datasets.
555555

556+
.. deprecated:: 0.21
557+
558+
As of version 0.21 this parameter has no effect, vendored joblib was
559+
removed and site joblib is always used.
560+
556561
:SKLEARN_ASSUME_FINITE:
557562

558563
Sets the default value for the `assume_finite` argument of

doc/whats_new/v0.21.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,16 @@ Multiple modules
634634
:issue:`13422` by :user:`Madhura Parikh <jdnc>` and
635635
:user:`Clément Doumouro <ClemDoum>`.
636636

637+
638+
Dependencies
639+
............
640+
641+
- |Enhancement| Joblib is no longer vendored in scikit-learn, and becomes a
642+
dependency. Minimal supported version is joblib 0.11, however using
643+
version >= 0.13 is strongly recommended.
644+
:issue:`13531` by :user:`Roman Yurchak <rth>`.
645+
646+
637647
Changes to estimator checks
638648
---------------------------
639649

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
SCIPY_MIN_VERSION = '0.17.0'
5858
NUMPY_MIN_VERSION = '1.11.0'
5959

60+
JOBLIB_MIN_VERSION = '0.11'
6061

6162
# Optional setuptools features
6263
# We need to import setuptools early, if we want setuptools features,
@@ -226,7 +227,8 @@ def setup_package():
226227
cmdclass=cmdclass,
227228
install_requires=[
228229
'numpy>={}'.format(NUMPY_MIN_VERSION),
229-
'scipy>={}'.format(SCIPY_MIN_VERSION)
230+
'scipy>={}'.format(SCIPY_MIN_VERSION),
231+
'joblib>={}'.format(JOBLIB_MIN_VERSION)
230232
],
231233
**extra_setuptools_args)
232234

sklearn/externals/README

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
This directory contains bundled external dependencies that are updated
22
every once in a while.
33

4-
Note to developers and advanced users: setting the SKLEARN_SITE_JOBLIB to
5-
a non null value will force scikit-learn to use the site joblib.
6-
74
Note for distribution packagers: if you want to remove the duplicated
85
code and depend on a packaged version, we suggest that you simply do a
96
symbolic link in this directory.

0 commit comments

Comments
 (0)