Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chen0040/c0c04de745b76ac7a36e3a5a7ad3e5e2 to your computer and use it in GitHub Desktop.
Save chen0040/c0c04de745b76ac7a36e3a5a7ad3e5e2 to your computer and use it in GitHub Desktop.
import re
import ast
import io
_version_re = re.compile(r'__version__\s+=\s+(.*)')
package_name = 'pyalgs'
with open(package_name + '/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment