def depend_on_a_file(self, path): path = os.path.abspath(path) if ((path.startswith('/usr/lib') or '/site-packages/' in path) and '/fingertip/' not in path): return self._deps_files[path] = (os.stat(path).st_mtime, weak_hash.of_file(path))
def file_has_not_changed(self, path): log.debug(f'checking that {path} has not changed...') mtime, hash_ = self._deps[path] if mtime != (os.stat(path).st_mtime): if hash_ != weak_hash.of_file(path): log.warning(f'{path} has changed, set ' 'FINGERTIP_IGNORE_CODE_CHANGES=1 to ignore') return False return True
def files_have_not_changed(self): if os.getenv('FINGERTIP_IGNORE_CODE_CHANGES', '0') != '0': return True for path, (mtime, hash_) in self._deps.items(): log.debug(f'checking that {path} has not changed...') if mtime != (os.stat(path).st_mtime): if hash_ != weak_hash.of_file(path): log.warning(f'{path} has changed, set ' 'FINGERTIP_IGNORE_CODE_CHANGES=1 to ignore') return False return True