def getVersionDir(): project_name = CONFIG['metadata']['project_name'] #print(project_name, '\n') version_dir = os.path.join(here, '../..', 'code', project_name) version_dir_2 = os.path.join(here, '../..', project_name) #print(version_dir, '\n', version_dir_2) if os.path.exists(version_dir): sys.path.insert(0, version_dir) import version version = version.set_version() elif os.path.exists(version_dir_2): sys.path.insert(0, version_dir_2) try: import version version = version.set_version() except ImportError: print('No module version found, setting version to 0.1.0') version = '0.1.0' else: version = '0.1.0' print(str('version not found, the directories: ' + version_dir + '\n' + 'or' + '\n' + version_dir_2 + 'do not seem to exist' + 'version set to 0.1.0' + 'Edit the Sphinx conf.py manually to change.' ) ) #print(version, '\n') return(version)
for key in CONFIG: for value in CONFIG[key]: print(key, value, CONFIG[key][value]) ################# ################# # Get version: #sys.path.insert(0, here) #src_dir = str(CONFIG['metadata']['project_name'] + '/' + CONFIG['metadata']['project_name']) src_dir = str(CONFIG['metadata']['project_name']) sys.path.insert(0, src_dir) print(src_dir) import version version = version.set_version() print(version) ################# ################# # Define dependencies for installation # Python version needed: major, minor1, minor2, s, tmp = sys.version_info if (major == 2 and minor1 < 7) or major < 2: raise SystemExit("""Python 2.7 or later required, exiting.""") # Get Ptyhon modules required: install_requires = []