Skip to content

Commit 9048578

Browse files
committed
Improve deprecation warning
1 parent 729d2ad commit 9048578

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

optimade/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44

55
import sys
66

7-
8-
class OptimadeDeprecationWarning(Warning):
9-
"""Special deprecation warning"""
10-
11-
127
if sys.version_info.minor == 6:
138
# Python 3.6
149
import warnings
1510

11+
warnings.filterwarnings(
12+
action="once",
13+
message=r"v0\.14 of the `optimade` package.*",
14+
category=DeprecationWarning,
15+
append=False,
16+
)
1617
warnings.warn(
1718
"v0.14 of the `optimade` package will be the last to support Python 3.6. "
1819
"Please upgrade to Python 3.7+ to use v0.15 and later versions of `optimade`.",
19-
OptimadeDeprecationWarning,
20+
DeprecationWarning,
2021
)

0 commit comments

Comments
 (0)