Skip to content

Commit a0e8e0f

Browse files
mr-cNilesh Patraglemaitre
authored
MAINT drop disutils and use scikit-learn fixes instead (#1065)
Co-authored-by: Nilesh Patra <nilesh@debian.org> Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
1 parent b4faf5f commit a0e8e0f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

doc/whats_new/v0.12.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Bug fixes
1515
`estimator` could not be a :class:`~sklearn.pipeline.Pipeline` object.
1616
:pr:`1049` by :user:`Gonenc Mogol <gmogol>`.
1717

18+
Compatibility
19+
.............
20+
21+
- Do not use `distutils` in tests due to deprecation.
22+
:pr:`1065` by :user:`Michael R. Crusoe <mr-c>`
23+
1824
Version 0.12.0
1925
==============
2026

imblearn/tensorflow/tests/test_generator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from distutils.version import LooseVersion
2-
31
import numpy as np
42
import pytest
53
from scipy import sparse
64
from sklearn.datasets import load_iris
5+
from sklearn.utils.fixes import parse_version
76

87
from imblearn.datasets import make_imbalance
98
from imblearn.over_sampling import RandomOverSampler
@@ -147,7 +146,7 @@ def accuracy(y_true, y_pred):
147146

148147
@pytest.mark.parametrize("sampler", [None, NearMiss(), RandomOverSampler()])
149148
def test_balanced_batch_generator(data, sampler):
150-
if LooseVersion(tf.__version__) < "2":
149+
if parse_version(tf.__version__) < parse_version("2.0.0"):
151150
check_balanced_batch_generator_tf_1_X_X(data, sampler)
152151
else:
153152
check_balanced_batch_generator_tf_2_X_X_compat_1_X_X(data, sampler)

0 commit comments

Comments
 (0)