Skip to content

Commit

Permalink
Remove MANIFEST.in use auto-generated one for sdists and package_data…
Browse files Browse the repository at this point in the history
… for wheels (#12960)

Using MANIFEST.in currently runs into a pretty nasty scikit-build bug (scikit-build/scikit-build#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 cudf 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.

I also reverted #12945, which was a stopgap solution to avoid this underlying problem. That change would have caused import issues inside the python/cudf directory when installing (the lack of an inplace build would have made the source tree unimportable) so this fix removes that minor limitation introduced in that PR.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #12960
  • Loading branch information
vyasr authored Mar 17, 2023
1 parent caef9a6 commit 8fbfb4a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 29 deletions.
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,9 @@ fi
if buildAll || hasArg cudf; then

cd ${REPODIR}/python/cudf
python setup.py build_ext --inplace -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUDF_BUILD_DIR} -DCMAKE_CUDA_ARCHITECTURES=${CUDF_CMAKE_CUDA_ARCHITECTURES} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1}
if [[ ${INSTALL_TARGET} != "" ]]; then
python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_CUDA_ARCHITECTURES=${CUDF_CMAKE_CUDA_ARCHITECTURES} -DCMAKE_LIBRARY_PATH=${LIBCUDF_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1}
else
python setup.py build_ext --inplace -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_CUDA_ARCHITECTURES=${CUDF_CMAKE_CUDA_ARCHITECTURES} -DCMAKE_LIBRARY_PATH=${LIBCUDF_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1}
python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUDF_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1}
fi
fi

Expand Down
16 changes: 0 additions & 16 deletions python/cudf/MANIFEST.in

This file was deleted.

5 changes: 3 additions & 2 deletions python/cudf/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from setuptools import find_packages
from skbuild import setup

packages = find_packages(include=["cudf*", "udf_cpp*"])
setup(
include_package_data=True,
packages=find_packages(include=["cudf", "cudf.*"]),
packages=packages,
package_data={key: ["*.pxd", "*.hpp", "*.cuh"] for key in packages},
zip_safe=False,
)
3 changes: 0 additions & 3 deletions python/cudf_kafka/MANIFEST.in

This file was deleted.

8 changes: 3 additions & 5 deletions python/cudf_kafka/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
)
]

packages = find_packages(include=["cudf_kafka*"])
setup(
# Include the separately-compiled shared library
ext_modules=cythonize(
Expand All @@ -89,10 +90,7 @@
profile=False, language_level=3, embedsignature=True
),
),
packages=find_packages(include=["cudf_kafka", "cudf_kafka.*"]),
package_data=dict.fromkeys(
find_packages(include=["cudf_kafka._lib*"]),
["*.pxd"],
),
packages=packages,
package_data={key: ["*.pxd"] for key in packages},
zip_safe=False,
)

0 comments on commit 8fbfb4a

Please sign in to comment.