Skip to content

Commit e69ec32

Browse files
committed
REF: Add keywordonly module to deprecation cycle
Marked for removal in version 5.0.0
1 parent 540e85e commit e69ec32

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

nibabel/keywordonly.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"""
33

44
from functools import wraps
5+
import warnings
6+
7+
warnings.warn("We will remove this module from nibabel 5.0. "
8+
"Please use the built-in Python `*` argument to ensure "
9+
"keyword-only parameters (see PEP 3102).",
10+
DeprecationWarning,
11+
stacklevel=2)
512

613

714
def kw_only_func(n):

nibabel/tests/test_removalschedule.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from ..testing import assert_raises, assert_false
33

44
MODULE_SCHEDULE = [
5+
('5.0.0', ['nibabel.keywordonly']),
56
('4.0.0', ['nibabel.trackvis']),
67
('3.0.0', ['nibabel.minc', 'nibabel.checkwarns']),
78
# Verify that the test will be quiet if the schedule outlives the modules

0 commit comments

Comments
 (0)