MCPcopy Index your code
hub / github.com/microsoft/SandDance / get_version

Function get_version

python/jupyter-widget/setupbase.py:80–88  ·  view source on GitHub ↗

Get the version of the package from the given file by executing it and extracting the given `name`.

(file, name='__version__')

Source from the content-addressed store, hash-verified

78# ---------------------------------------------------------------------------
79
80def get_version(file, name='__version__'):
81 """Get the version of the package from the given file by
82 executing it and extracting the given `name`.
83 """
84 path = os.path.realpath(file)
85 version_ns = {}
86 with io.open(path, encoding="utf8") as f:
87 exec(f.read(), {}, version_ns)
88 return version_ns[name]
89
90
91def ensure_python(specs):

Callers 1

setup.pyFile · 0.90

Calls 1

openMethod · 0.65

Tested by

no test coverage detected