MCPcopy Index your code
hub / github.com/ipython/ipython / target_outdated

Function target_outdated

setupbase.py:116–137  ·  view source on GitHub ↗

Determine whether a target is out of date. target_outdated(target,deps) -> 1/0 deps: list of filenames which MUST exist. target: single filename which may or may not exist. If target doesn't exist or is older than any file listed in deps, return true, otherwise return false.

(target, deps)

Source from the content-addressed store, hash-verified

114# to import IPython during setup, which fails on Python 3.
115
116def target_outdated(target, deps):
117 """Determine whether a target is out of date.
118
119 target_outdated(target,deps) -> 1/0
120
121 deps: list of filenames which MUST exist.
122 target: single filename which may or may not exist.
123
124 If target doesn't exist or is older than any file listed in deps, return
125 true, otherwise return false.
126 """
127 try:
128 target_time = Path(target).stat().st_mtime
129 except FileNotFoundError:
130 return 1
131 for dep in deps:
132 dep_time = Path(dep).stat().st_mtime
133 if dep_time > target_time:
134 # print("For target",target,"Dep failed:",dep) # dbg
135 # print("times (dep,tar):",dep_time,target_time) # dbg
136 return 1
137 return 0
138
139
140def target_update(target, deps, cmd):

Callers 1

target_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…