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

Method inplace_dir

setup.py:364–374  ·  view source on GitHub ↗

For a `BuiltFile`, we use self.dst as its inplace directory path. Need to handle directory vs file.

(self, installer: "InstallerBuildExt")

Source from the content-addressed store, hash-verified

362 return dst_root / Path(self.dst)
363
364 def inplace_dir(self, installer: "InstallerBuildExt") -> Path:
365 """For a `BuiltFile`, we use self.dst as its inplace directory path.
366 Need to handle directory vs file.
367 """
368 # HACK: get rid of the leading "executorch" in ext.dst.
369 # This is because we don't have a root level "executorch" module.
370 package_dir = self.dst.removeprefix("executorch/")
371 # If dst is a file, use it's directory
372 if not package_dir.endswith("/"):
373 package_dir = os.path.dirname(package_dir)
374 return Path(package_dir)
375
376
377class BuiltExtension(_BaseExtension):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected