Skip to content

Commit 5f98136

Browse files
authored
MAINT update the python version supported (#1073)
1 parent a0e8e0f commit 5f98136

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

doc/whats_new/v0.12.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ Compatibility
1919
.............
2020

2121
- Do not use `distutils` in tests due to deprecation.
22-
:pr:`1065` by :user:`Michael R. Crusoe <mr-c>`
22+
:pr:`1065` by :user:`Michael R. Crusoe <mr-c>`.
23+
24+
- Fix the scikit-learn import in tests to be compatible with version 1.4.1.post1.
25+
:pr:`1073` by :user:`Guillaume Lemaitre <glemaitre>`.
26+
27+
- Fix test to be compatible with Python 3.13.
28+
:pr:`1073` by :user:`Guillaume Lemaitre <glemaitre>`.
2329

2430
Version 0.12.0
2531
==============

imblearn/utils/tests/test_docstring.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
44
# License: MIT
55

6+
import sys
7+
import textwrap
8+
69
import pytest
710

811
from imblearn.utils import Substitution
912
from imblearn.utils._docstring import _n_jobs_docstring, _random_state_docstring
1013

14+
15+
def _dedent_docstring(docstring):
16+
"""Compatibility with Python 3.13+.
17+
18+
xref: https://github.com/python/cpython/issues/81283
19+
"""
20+
return "\n".join([textwrap.dedent(line) for line in docstring.split("\n")])
21+
22+
1123
func_docstring = """A function.
1224
1325
Parameters
@@ -55,6 +67,11 @@ def __init__(self, param_1, param_2):
5567
self.param_2 = param_2
5668

5769

70+
if sys.version_info.minor == "13":
71+
func_docstring = _dedent_docstring(func_docstring)
72+
cls_docstring = _dedent_docstring(cls_docstring)
73+
74+
5875
@pytest.mark.parametrize(
5976
"obj, obj_docstring", [(func, func_docstring), (cls, cls_docstring)]
6077
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
"Operating System :: POSIX",
5050
"Operating System :: Unix",
5151
"Operating System :: MacOS",
52-
"Programming Language :: Python :: 3.8",
5352
"Programming Language :: Python :: 3.9",
5453
"Programming Language :: Python :: 3.10",
5554
"Programming Language :: Python :: 3.11",
55+
"Programming Language :: Python :: 3.12",
5656
]
5757
PYTHON_REQUIRES = ">=3.8"
5858
INSTALL_REQUIRES = (min_deps.tag_to_packages["install"],)

0 commit comments

Comments
 (0)