MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / get_version

Function get_version

setup.py:85–96  ·  view source on GitHub ↗

Read version from a file via text parsing, following PyPA guide.

(rel_path)

Source from the content-addressed store, hash-verified

83 return os.path.join(prefix, "lib")
84
85def get_version(rel_path):
86 """Read version from a file via text parsing, following PyPA guide."""
87 def read(rel_path):
88 here = os.path.abspath(os.path.dirname(__file__))
89 with codecs.open(os.path.join(here, rel_path), "r") as fp:
90 return fp.read()
91 for line in read(rel_path).splitlines():
92 if line.startswith("__version__"):
93 delim = '"' if '"' in line else "'"
94 return line.split(delim)[1]
95 else:
96 raise RuntimeError("Unable to find version string.")
97
98# Configuratin
99INCLUDE_MPI = True

Callers 1

setup.pyFile · 0.85

Calls 2

readFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected