Read version from a file via text parsing, following PyPA guide.
(rel_path)
| 83 | return os.path.join(prefix, "lib") |
| 84 | |
| 85 | def 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 |
| 99 | INCLUDE_MPI = True |