updated python setup files so that example data is loaded correctly
parent
3a80b38a9a
commit
7477f9e0b0
|
@ -0,0 +1 @@
|
|||
recursive-include gtsam/Data *
|
|
@ -1,6 +1,4 @@
|
|||
import glob
|
||||
import os
|
||||
import sys
|
||||
"""Setup file to install the GTSAM package."""
|
||||
|
||||
try:
|
||||
from setuptools import setup, find_packages
|
||||
|
@ -10,19 +8,17 @@ except ImportError:
|
|||
packages = find_packages(where=".")
|
||||
print("PACKAGES: ", packages)
|
||||
|
||||
data_path = '${GTSAM_SOURCE_DIR}/examples/Data/'
|
||||
data_files_and_directories = glob.glob(data_path + '**', recursive=True)
|
||||
data_files = [x for x in data_files_and_directories if not os.path.isdir(x)]
|
||||
|
||||
package_data = {
|
||||
'': [
|
||||
'./*.so',
|
||||
'./*.dll',
|
||||
"./*.so",
|
||||
"./*.dll",
|
||||
"Data/*" # Add the data files to the package
|
||||
"Data/**/*" # Add the data files in subdirectories
|
||||
]
|
||||
}
|
||||
|
||||
# Cleaner to read in the contents rather than copy them over.
|
||||
readme_contents = open("${PROJECT_SOURCE_DIR}/README.md").read()
|
||||
readme_contents = open("${GTSAM_SOURCE_DIR}/README.md").read()
|
||||
|
||||
setup(
|
||||
name='gtsam',
|
||||
|
@ -49,9 +45,9 @@ setup(
|
|||
'Programming Language :: Python :: 3',
|
||||
],
|
||||
packages=packages,
|
||||
include_package_data=True,
|
||||
package_data=package_data,
|
||||
data_files=[('${GTSAM_PYTHON_DATASET_DIR}', data_files),],
|
||||
test_suite="gtsam.tests",
|
||||
install_requires=["numpy"],
|
||||
install_requires=open("${GTSAM_SOURCE_DIR}/python/requirements.txt").readlines(),
|
||||
zip_safe=False,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue