MCPcopy Create free account
hub / github.com/pytorch/executorch / src_path

Method src_path

setup.py:417–437  ·  view source on GitHub ↗

Returns the path to the source file, resolving globs. Args: installer: The InstallerBuildExt instance that is installing the file.

(self, installer: "InstallerBuildExt")

Source from the content-addressed store, hash-verified

415 )
416
417 def src_path(self, installer: "InstallerBuildExt") -> Path:
418 """Returns the path to the source file, resolving globs.
419
420 Args:
421 installer: The InstallerBuildExt instance that is installing the
422 file.
423 """
424 try:
425 return super().src_path(installer)
426 except ValueError:
427 # Probably couldn't find the file. If the path ends with .so, try
428 # looking for a .dylib file instead, in case we're running on macos.
429 if self.src.endswith(".so"):
430 dylib_src = re.sub(r"\.so$", ".dylib", self.src)
431 return BuiltExtension(
432 src=dylib_src,
433 modpath=self.dst,
434 dependent_cmake_flags=self.dependent_cmake_flags,
435 ).src_path(installer)
436 else:
437 raise
438
439 def dst_path(self, installer: "InstallerBuildExt") -> Path:
440 """Returns the path to the destination file.

Callers

nothing calls this directly

Calls 2

BuiltExtensionClass · 0.85
src_pathMethod · 0.45

Tested by

no test coverage detected