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

Method string

setup.py:139–155  ·  view source on GitHub ↗

The version string.

(cls)

Source from the content-addressed store, hash-verified

137
138 @classmethod
139 def string(cls) -> str:
140 """The version string."""
141 if cls.__string_attr is None:
142 # If set, BUILD_VERSION should override any local version
143 # information. CI will use this to manage, e.g., release vs. nightly
144 # versions.
145 version = os.getenv("BUILD_VERSION", "").strip()
146 if not version:
147 # Otherwise, read the version from a local file and add the git
148 # commit if available.
149 version = (
150 open(os.path.join(cls._root_dir(), "version.txt")).read().strip()
151 )
152 if cls.git_hash():
153 version += "+" + cls.git_hash()[:7] # type: ignore[index]
154 cls.__string_attr = version
155 return cls.__string_attr
156
157 @classmethod
158 def write_to_python_file(cls, path: str) -> None:

Callers 2

write_to_python_fileMethod · 0.45
setup.pyFile · 0.45

Calls 2

_root_dirMethod · 0.80
git_hashMethod · 0.80

Tested by

no test coverage detected