Use setup.py to install config data to python library
data under conf/ will be used by all test cases as the general config data. Each unittest will override config data under this dir with their specific attributes. This CL is to include config data in the python lib. Change-Id: I53b55591c7a70fd0a9f6634d509df6bfdeb604bd
This commit is contained in:
parent
d1ee9e7e36
commit
f4aa063a56
10
setup.py
10
setup.py
@ -66,6 +66,14 @@ INSTALL_REQUIRES_DIR = os.path.join(
|
||||
with open(INSTALL_REQUIRES_DIR, 'r') as requires_file:
|
||||
REQUIREMENTS = [line.strip() for line in requires_file if line != '\n']
|
||||
|
||||
DATA_FILES_DIR = os.path.join(
|
||||
os.path.dirname(__file__), 'conf')
|
||||
DATA_FILES = []
|
||||
for parent_dir, sub_dirs, files in os.walk(DATA_FILES_DIR):
|
||||
if files == []:
|
||||
pass
|
||||
for file in files:
|
||||
DATA_FILES.append((parent_dir, [os.path.join(parent_dir, file)]))
|
||||
|
||||
setup(
|
||||
name='compass',
|
||||
@ -94,6 +102,8 @@ setup(
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
],
|
||||
# data
|
||||
data_files=DATA_FILES,
|
||||
# test,
|
||||
tests_require=['tox'],
|
||||
cmdclass={'test': Tox},
|
||||
|
Loading…
Reference in New Issue
Block a user