Skip to content

Commit 0675ebb

Browse files
authored
Deprecate Python 3.6 support, v0.14 last supported version (#751)
Implement deprecation warning in root __init__. A warnings filter, specifically for this deprecation warning, has been prepended to ensure it will be shown once, when anything is imported from the `optimade` package.
1 parent 46c9a8f commit 0675ebb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

optimade/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
11
__version__ = "0.13.3"
22
__api_version__ = "1.0.1"
3+
4+
5+
import sys
6+
7+
if sys.version_info.minor == 6:
8+
# Python 3.6
9+
import warnings
10+
11+
warnings.filterwarnings(
12+
action="once",
13+
message=r"v0\.14 of the `optimade` package.*",
14+
category=DeprecationWarning,
15+
append=False,
16+
)
17+
warnings.warn(
18+
"v0.14 of the `optimade` package will be the last to support Python 3.6. "
19+
"Please upgrade to Python 3.7+ to use v0.15 and later versions of `optimade`.",
20+
DeprecationWarning,
21+
)

0 commit comments

Comments
 (0)