Created
February 2, 2016 15:45
-
-
Save inirudebwoy/2071aae90898997d610e to your computer and use it in GitHub Desktop.
Retrievinng version number in setup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_version(): | |
local_vars = {} | |
try: | |
execfile('src/imagination/objectid_manager/__init__.py', | |
{}, | |
local_vars) | |
except NameError: | |
# python3.x does not provide execfile | |
with open('src/imagination/objectid_manager/__init__.py') as f: | |
exec(f.read(), {}, local_vars) | |
return local_vars.get('__version__') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment