Show More
@@ -12,6 +12,7 b' import errno' | |||||
12 | import shutil |
|
12 | import shutil | |
13 | import random |
|
13 | import random | |
14 | import glob |
|
14 | import glob | |
|
15 | import warnings | |||
15 |
|
16 | |||
16 | from IPython.utils.process import system |
|
17 | from IPython.utils.process import system | |
17 |
|
18 | |||
@@ -292,7 +293,14 b' def target_outdated(target,deps):' | |||||
292 |
|
293 | |||
293 | If target doesn't exist or is older than any file listed in deps, return |
|
294 | If target doesn't exist or is older than any file listed in deps, return | |
294 | true, otherwise return false. |
|
295 | true, otherwise return false. | |
|
296 | ||||
|
297 | .. deprecated:: 8.22 | |||
295 | """ |
|
298 | """ | |
|
299 | warnings.warn( | |||
|
300 | "`target_outdated` is deprecated since IPython 8.22 and will be removed in future versions", | |||
|
301 | DeprecationWarning, | |||
|
302 | stacklevel=2, | |||
|
303 | ) | |||
296 | try: |
|
304 | try: | |
297 | target_time = os.path.getmtime(target) |
|
305 | target_time = os.path.getmtime(target) | |
298 | except os.error: |
|
306 | except os.error: | |
@@ -312,9 +320,17 b' def target_update(target,deps,cmd):' | |||||
312 | target_update(target,deps,cmd) -> runs cmd if target is outdated. |
|
320 | target_update(target,deps,cmd) -> runs cmd if target is outdated. | |
313 |
|
321 | |||
314 | This is just a wrapper around target_outdated() which calls the given |
|
322 | This is just a wrapper around target_outdated() which calls the given | |
315 |
command if target is outdated. |
|
323 | command if target is outdated. | |
|
324 | ||||
|
325 | .. deprecated:: 8.22 | |||
|
326 | """ | |||
316 |
|
327 | |||
317 | if target_outdated(target,deps): |
|
328 | warnings.warn( | |
|
329 | "`target_update` is deprecated since IPython 8.22 and will be removed in future versions", | |||
|
330 | DeprecationWarning, | |||
|
331 | stacklevel=2, | |||
|
332 | ) | |||
|
333 | if target_outdated(target, deps): | |||
318 | system(cmd) |
|
334 | system(cmd) | |
319 |
|
335 | |||
320 |
|
336 |
General Comments 0
You need to be logged in to leave comments.
Login now