(filename)
| 5 | |
| 6 | |
| 7 | def get_version(filename): |
| 8 | import re |
| 9 | |
| 10 | with open(filename) as fd: |
| 11 | data = fd.read() |
| 12 | |
| 13 | mobj = re.search( |
| 14 | r"""^__version__\s*=\s*(?P<quote>['"])(?P<version>.*)(?P=quote)""", |
| 15 | data, |
| 16 | re.MULTILINE, |
| 17 | ) |
| 18 | return mobj.group("version") |
| 19 | |
| 20 | |
| 21 | # -- Project information ----------------------------------------------------- |