From 79782d876c0fe57de7eb3e6abfe8e425441bb31e Mon Sep 17 00:00:00 2001 From: Laksh Agarwal Date: Fri, 13 Nov 2026 01:10:43 -0500 Subject: [PATCH] Don't install source files at the environment root MANIFEST.in includes cpp/, CMakeLists.txt, setup.py, etc. so that the sdist can be built. Because pyproject.toml has a [project] table, include_package_data defaults to True, and scikit-build then installs every MANIFEST.in entry that is outside a Python package as a data file, which pip puts at the root of the environment. Turn include_package_data off and list the package's only non-Python files (the adapter test data) in package_data. Discover packages with find_namespace_packages so that csp.build and csp.tests.build, which have no __init__.py, are still included. The files under csp/ in the wheel are unchanged; the sdist is unchanged. Fixes #526 Signed-off-by: Laksh Agarwal --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b14fbca10..4e5982483 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ import sys from shutil import which +from setuptools import find_namespace_packages from skbuild import setup CSP_USE_VCPKG = os.environ.get("CSP_USE_VCPKG", "1").lower() in ("1", "on") @@ -150,7 +151,14 @@ setup( name="csp", version="0.19.1", - packages=["csp"], + # Namespace discovery, because some subpackages (e.g. csp.build) have no __init__.py + packages=find_namespace_packages(include=["csp", "csp.*"]), + # MANIFEST.in pulls in cpp/, CMakeLists.txt, etc. for the sdist. With include_package_data, + # scikit-build would also install every such file outside a package as a data file at the + # root of the user's environment (https://github.com/Point72/csp/issues/526), so list the + # package's non-Python files explicitly instead. + include_package_data=False, + package_data={"csp": ["tests/adapters/*.arrow", "tests/adapters/*.csv", "tests/adapters/*.parquet"]}, cmake_install_dir="csp", cmake_args=cmake_args, # cmake_with_sdist=True,