Better reading of path to metadata.py file in setup.py

This commit is contained in:
Niru Maheswaranathan
2017-05-25 12:42:48 -07:00
parent 412e02b297
commit d7596f611f
3 changed files with 5 additions and 3 deletions

View File

@@ -1,8 +1,10 @@
import re
import os
from setuptools import setup
with open('metadata.py', 'r') as f:
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
with open(os.path.join(__location__, 'metadata.py'), 'r') as f:
metadata = dict(re.findall("__([a-z_]+)__\s*=\s*'([^']+)'", f.read()))