MCPcopy Create free account
hub / github.com/catboost/catboost / _detect_source_root

Method _detect_source_root

library/python/testing/yatest_lib/ya.py:221–236  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

219 return self._context.get(key)
220
221 def _detect_source_root(self):
222 root = None
223 try:
224 import library.python.find_root
225 # try to determine source root from cwd
226 cwd = os.getcwd()
227 root = library.python.find_root.detect_root(cwd)
228
229 if not root:
230 # try to determine root pretending we are in the test work dir made from --keep-temps run
231 env_subdir = os.path.join("environment", "arcadia")
232 root = library.python.find_root.detect_root(cwd, detector=lambda p: os.path.exists(os.path.join(p, env_subdir)))
233 except ImportError:
234 logging.warning("Unable to import library.python.find_root")
235
236 return root
237
238 def _detect_output_root(self):
239

Callers 1

__init__Method · 0.95

Calls 2

warningMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected