From 40f246dd746e2f6be1aac80dd804e5fdefd7206e Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 16 Mar 2023 22:00:11 -0400 Subject: [PATCH] Remove MANIFEST.in use auto-generated one for sdists and package_data for wheels (#1348) Using MANIFEST.in currently runs into a pretty nasty scikit-build bug (https://github.com/scikit-build/scikit-build/issues/886) that results in any file included by the manifest being copied from the install tree back into the source tree whenever an in place build occurs after an install, overwriting any local changes. We need an alternative approach to ensure that all necessary files are included in built packages. There are two types: - sdists: scikit-build automatically generates a manifest during sdist generation if we don't provide one, and that manifest is reliably complete. It contains all files needed for a source build up to the raft C++ code (which has always been true and is something we can come back to improving later if desired). - wheels: The autogenerated manifest is not used during wheel generation because the manifest generation hook is not invoked during wheel builds, so to include data in the wheels we must provide the `package_data` argument to `setup`. In this case we do not need to include CMake or pyx files because the result does not need to be possible to build from, it just needs pxd files for other packages to cimport if desired. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Ben Frederickson (https://github.com/benfred) URL: https://github.com/rapidsai/raft/pull/1348 --- python/pylibraft/MANIFEST.in | 7 ------- python/pylibraft/setup.py | 5 +++-- python/raft-dask/MANIFEST.in | 7 ------- python/raft-dask/setup.py | 5 +++-- 4 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 python/pylibraft/MANIFEST.in delete mode 100644 python/raft-dask/MANIFEST.in diff --git a/python/pylibraft/MANIFEST.in b/python/pylibraft/MANIFEST.in deleted file mode 100644 index 761f403b54..0000000000 --- a/python/pylibraft/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -# Cython files -recursive-include pylibraft *.pxd -recursive-include pylibraft *.pyx - -# Build files. Don't use a recursive include on '.' in case the repo is dirty -include . CMakeLists.txt -recursive-include pylibraft CMakeLists.txt diff --git a/python/pylibraft/setup.py b/python/pylibraft/setup.py index d00e36d804..d1a73629ef 100644 --- a/python/pylibraft/setup.py +++ b/python/pylibraft/setup.py @@ -27,10 +27,11 @@ def exclude_libcxx_symlink(cmake_manifest): ) +packages = find_packages(include=["pylibraft*"]) setup( - include_package_data=True, # Don't want libcxx getting pulled into wheel builds. cmake_process_manifest_hook=exclude_libcxx_symlink, - packages=find_packages(include=["pylibraft", "pylibraft.*"]), + packages=packages, + package_data={key: ["*.pxd"] for key in packages}, zip_safe=False, ) diff --git a/python/raft-dask/MANIFEST.in b/python/raft-dask/MANIFEST.in deleted file mode 100644 index f160a731e9..0000000000 --- a/python/raft-dask/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -# Cython files -recursive-include raft-dask *.pxd -recursive-include raft-dask *.pyx - -# Build files. Don't use a recursive include on '.' in case the repo is dirty -include . CMakeLists.txt -recursive-include raft-dask CMakeLists.txt diff --git a/python/raft-dask/setup.py b/python/raft-dask/setup.py index c9215e96e6..391be0ac72 100644 --- a/python/raft-dask/setup.py +++ b/python/raft-dask/setup.py @@ -27,9 +27,10 @@ def exclude_libcxx_symlink(cmake_manifest): ) +packages = find_packages(include=["raft_dask*"]) setup( - include_package_data=True, cmake_process_manifest_hook=exclude_libcxx_symlink, - packages=find_packages(include=["raft_dask", "raft_dask.*"]), + packages=packages, + package_data={key: ["*.pxd"] for key in packages}, zip_safe=False, )