From 2af3d0339f3635ad36911a4d9bef7167ae2be673 2024-02-22 10:04:52 From: M Bussonnier Date: 2024-02-22 10:04:52 Subject: [PATCH] IPython/utils/path.py: Deprecate unused `target_outdated`, `target_update` (#14348) These functions are unused. I propose to deprecate them (`setupbase.py` brings its own copy of these functions.) --- diff --git a/IPython/utils/path.py b/IPython/utils/path.py index ccb70dc..cb5be04 100644 --- a/IPython/utils/path.py +++ b/IPython/utils/path.py @@ -12,6 +12,7 @@ import errno import shutil import random import glob +import warnings from IPython.utils.process import system @@ -292,7 +293,14 @@ def target_outdated(target,deps): If target doesn't exist or is older than any file listed in deps, return true, otherwise return false. + + .. deprecated:: 8.22 """ + warnings.warn( + "`target_outdated` is deprecated since IPython 8.22 and will be removed in future versions", + DeprecationWarning, + stacklevel=2, + ) try: target_time = os.path.getmtime(target) except os.error: @@ -312,9 +320,17 @@ def target_update(target,deps,cmd): target_update(target,deps,cmd) -> runs cmd if target is outdated. This is just a wrapper around target_outdated() which calls the given - command if target is outdated.""" + command if target is outdated. + + .. deprecated:: 8.22 + """ - if target_outdated(target,deps): + warnings.warn( + "`target_update` is deprecated since IPython 8.22 and will be removed in future versions", + DeprecationWarning, + stacklevel=2, + ) + if target_outdated(target, deps): system(cmd)