From a98409ff5fd5d971c712e50585d90a36cc95ac52 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Mon, 16 Sep 2024 11:33:47 -0600 Subject: [PATCH] Add v1.x deprecation warning (#603) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jessica Scheick Co-authored-by: Jessica Scheick --- icepyx/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/icepyx/__init__.py b/icepyx/__init__.py index a9d61834b..b0cd8095d 100644 --- a/icepyx/__init__.py +++ b/icepyx/__init__.py @@ -1,3 +1,17 @@ +from warnings import warn + +deprecation_msg = """icepyx v1.x is being deprecated; the back-end systems on which it relies +will be shut down as of late 2024. At that time, upgrade to icepyx v2.x, which uses the +new NASA Harmony back-end, will be required. Please see + for more +information! +""" +# IMPORTANT: This is being done before the other icepyx imports because the imported +# code changes warning filters. If this is done after the imports, the warning won't +# work. +warn(deprecation_msg, FutureWarning, stacklevel=2) + + from _icepyx_version import version as __version__ from icepyx.core.query import GenQuery, Query