Skip to content

Commit c98b694

Browse files
authored
Drop Python 2 support (#1018)
1 parent 5b7acb6 commit c98b694

Some content is hidden

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

42 files changed

+863
-1328
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Latest changes
44
Release 0.14.2
55
--------------
66

7+
- Drop support for Python 2 and Python 3.5. All objects in
8+
``joblib.my_exceptions`` and ``joblib.format_stack`` are now deprecated and
9+
will be removed in joblib 0.16. Note that no deprecation warning will be
10+
raised for these objects Python < 3.7.
11+
https://github.com/joblib/joblib/pull/1018
12+
713
- Fix the number of jobs reported by ``effective_n_jobs`` when ``n_jobs=None``
814
called in a parallel backend context.
915
https://github.com/joblib/joblib/pull/985

azure-pipelines.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,25 @@ jobs:
6262
PYTHON_VERSION: "3.6"
6363
EXTRA_CONDA_PACKAGES: "numpy=1.14"
6464
JOBLIB_MULTIPROCESSING: "0"
65-
linux_py35_no_numpy:
65+
linux_py36_no_numpy:
6666
imageName: 'ubuntu-latest'
67-
PYTHON_VERSION: "3.5"
68-
linux_py27_no_lza:
69-
imageName: 'ubuntu-latest'
70-
NO_LZ4: "true"
71-
PYTHON_VERSION: "2.7"
72-
EXTRA_CONDA_PACKAGES: "numpy=1.16"
67+
PYTHON_VERSION: "3.6"
7368

7469
windows_py38:
7570
imageName: "vs2017-win2016"
7671
PYTHON_VERSION: "3.8"
7772
EXTRA_CONDA_PACKAGES: "numpy=1.18"
78-
windows_py35_no_numpy:
73+
windows_py36_no_numpy:
7974
imageName: "vs2017-win2016"
80-
PYTHON_VERSION: "3.5"
81-
windows-py27:
82-
imageName: "vs2017-win2016"
83-
PYTHON_VERSION: "2.7"
84-
EXTRA_CONDA_PACKAGES: "numpy=1.16"
75+
PYTHON_VERSION: "3.6"
8576

8677
macos_py38:
8778
imageName: "macos-10.14"
8879
PYTHON_VERSION: "3.8"
8980
EXTRA_CONDA_PACKAGES: "numpy=1.18"
90-
macos_py35_no_numpy:
91-
imageName: "macos-10.14"
92-
PYTHON_VERSION: "3.5"
93-
macos_py27:
81+
macos_py36_no_numpy:
9482
imageName: "macos-10.14"
95-
PYTHON_VERSION: "2.7"
96-
EXTRA_CONDA_PACKAGES: "numpy=1.16"
97-
83+
PYTHON_VERSION: "3.6"
9884

9985
variables:
10086
JUNITXML: 'test-data.xml'

conftest.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,12 @@ def pytest_configure(config):
5353

5454

5555
def pytest_unconfigure(config):
56-
try:
57-
# Setup a global traceback printer callback to debug deadlocks that
58-
# would happen once pytest has completed: for instance in atexit
59-
# finalizers. At this point the stdout/stderr capture of pytest
60-
# should be disabled.
56+
# Setup a global traceback printer callback to debug deadlocks that
57+
# would happen once pytest has completed: for instance in atexit
58+
# finalizers. At this point the stdout/stderr capture of pytest
59+
# should be disabled.
6160

62-
# Note that we also use a shorter timeout for the per-test callback
63-
# configured via the pytest-timeout extension.
64-
import faulthandler
65-
faulthandler.dump_traceback_later(60, exit=True)
66-
except ImportError:
67-
# Python 2 backward compat.
68-
pass
61+
# Note that we also use a shorter timeout for the per-test callback
62+
# configured via the pytest-timeout extension.
63+
import faulthandler
64+
faulthandler.dump_traceback_later(60, exit=True)

continuous_integration/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ create_new_conda_env() {
1818
}
1919

2020
create_new_pypy3_env() {
21-
PYPY_FOLDER="pypy3-v6.0.0-linux64"
21+
PYPY_FOLDER="pypy3.6-v7.3.1-linux64"
2222
wget https://bitbucket.org/pypy/pypy/downloads/$PYPY_FOLDER.tar.bz2
2323
tar xvf $PYPY_FOLDER.tar.bz2
2424
$PYPY_FOLDER/bin/pypy3 -m venv pypy3
@@ -53,7 +53,7 @@ if [[ "$COVERAGE" == "true" ]]; then
5353
PIP_INSTALL_PACKAGES="$PIP_INSTALL_PACKAGES coverage==4.5.4 pytest-cov codecov"
5454
fi
5555

56-
if [[ "2.7 3.4 pypy3" != *"$PYTHON_VERSION"* ]]; then
56+
if [[ "pypy3" != *"$PYTHON_VERSION"* ]]; then
5757
# threadpoolctl is only available for python 3.5+.
5858
PIP_INSTALL_PACKAGES="$PIP_INSTALL_PACKAGES threadpoolctl"
5959
fi

continuous_integration/run_tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ if [[ "$SKIP_TESTS" != "true" ]]; then
2121
fi
2222

2323
pytest joblib -vl --timeout=60 --junitxml="${JUNITXML}"
24-
if [[ "$PYTHON_VERSION" != "2.7" ]]; then
25-
make test-doc
26-
fi
24+
make test-doc
2725
fi
2826

2927
if [[ "$SKLEARN_TESTS" == "true" ]]; then

joblib/_compat.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

joblib/_dask.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ def is_weakrefable(obj):
3535
return False
3636

3737

38-
try:
39-
TimeoutError = TimeoutError
40-
except NameError:
41-
# Python 2 backward compat
42-
class TimeoutError(OSError):
43-
pass
44-
45-
4638
class _WeakKeyDictionary:
4739
"""A variant of weakref.WeakKeyDictionary for unhashable objects.
4840

0 commit comments

Comments
 (0)