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
|
"""Setup file to install the GTSAM package."""
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
@ -10,19 +8,17 @@ except ImportError:
|
||||||
packages = find_packages(where=".")
|
packages = find_packages(where=".")
|
||||||
print("PACKAGES: ", packages)
|
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 = {
|
package_data = {
|
||||||
'': [
|
'': [
|
||||||
'./*.so',
|
"./*.so",
|
||||||
'./*.dll',
|
"./*.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.
|
# 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(
|
setup(
|
||||||
name='gtsam',
|
name='gtsam',
|
||||||
|
@ -49,9 +45,9 @@ setup(
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
],
|
],
|
||||||
packages=packages,
|
packages=packages,
|
||||||
|
include_package_data=True,
|
||||||
package_data=package_data,
|
package_data=package_data,
|
||||||
data_files=[('${GTSAM_PYTHON_DATASET_DIR}', data_files),],
|
|
||||||
test_suite="gtsam.tests",
|
test_suite="gtsam.tests",
|
||||||
install_requires=["numpy"],
|
install_requires=open("${GTSAM_SOURCE_DIR}/python/requirements.txt").readlines(),
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue