[python] more robust way to add triton includes to python package

This commit is contained in:
Philippe Tillet
2019-09-05 16:01:56 -04:00
parent 945593e847
commit 0a6329ea7d
3 changed files with 8 additions and 7 deletions

View File

@@ -84,9 +84,7 @@ directories = [x[0] for x in os.walk(os.path.join(os.path.pardir, 'include'))]
data = []
for d in directories:
files = glob.glob(os.path.join(d, '*.h'), recursive=False)
dest = os.path.relpath(d, os.path.pardir)
dest = os.path.join('triton', '_C', dest)
data += [(dest, files)]
data += [os.path.relpath(f, os.path.pardir) for f in files]
setup(
name='triton',
@@ -95,8 +93,8 @@ setup(
author_email='ptillet@g.harvard.edu',
description='A language and compiler for custom Deep Learning operations',
long_description='',
packages=['triton', 'triton/ops'],
data_files=data,
packages=['triton', 'triton/_C', 'triton/ops'],
package_data={'': data},
ext_modules=[CMakeExtension('triton', 'triton/_C/')],
cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,