def version(path):
version_file = read(path)<EOL>version_match = re.search(r"""<STR_LIT>""",<EOL>version_file, re.M)<EOL>if version_match:<EOL><INDENT>return version_match.group(<NUM_LIT:1>)<EOL><DEDENT>raise RuntimeError("<STR_LIT>")<EOL>
Obtain the packge version from a python file e.g. pkg/__init__.py
    See <https://packaging.python.org/en/latest/single_source_version.html>.