Use recursive blob for package data (#119257)

setup.py now supports recursive glob for package data

I only added `.cpp`, `.h`, and `.yaml` files. Not sure if you want to include BAZEL or other files in package_data.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/119257
Approved by: https://github.com/zou3519
This commit is contained in:
Timmy Xiao
2024-04-20 06:33:36 +00:00
committed by PyTorch MergeBot
parent 0d0b5b2655
commit f20e3ae0c3

View File

@ -1387,15 +1387,9 @@ def main():
]
)
torchgen_package_data = [
# Recursive glob doesn't work in setup.py,
# https://github.com/pypa/setuptools/issues/1806
# To make this robust we should replace it with some code that
# returns a list of everything under packaged/
"packaged/ATen/*",
"packaged/ATen/native/*",
"packaged/ATen/templates/*",
"packaged/autograd/*",
"packaged/autograd/templates/*",
"packaged/**/*.cpp",
"packaged/**/*.h",
"packaged/**/*.yaml",
]
setup(
name=package_name,