#Hello! I'm running into an issue where
1 messages · Page 1 of 1 (latest)
Do you have a repo I can try? That looks roughly correct, though you shouldn't need the wheel.exclude, it only adds what it finds in the wheel.packages and what you install from CMake.
You can inspect a wheel's contents with unzip -l dist/*.whl
Basically just a recursive clone and a python -m build --sdist --wheel
you shouldn't need the wheel.exclude, it only adds what it finds in the wheel.packages and what you install from CMake.
I’m trying to exclude everything installed by CMake and just keep that one directory in site-packages.
Can you use components for that? Make a component and then tell it to only install that one? I'll try it soon but it downloads the whole LLVM repo 😉
You are using the setuptools plugin I see
You are setting the LLVM project as the source dir, not your CMakeLists?
I tried setting the current CMakeLists and got Could not find a package configuration file provided by "MLIR"
It does indeed; but I made it so it’s a shallow clone.
I did put the LLVM repo as the source in setup.py, that’s intentional. I’m building LLVM and this project together using some CMake defines.
Specifically these:
LLVM_EXTERNAL_PROJECTS = "finch"
LLVM_EXTERNAL_FINCH_SOURCE_DIR= "."
Installing just one component becomes hard when LLVM is controlling the build process. The alternative is ExternalProject_Add but that’s gonna build/install it too IIUC.
Weirdly enough, neither the scikit-build-core options nor the setuptools options work here to exclude something. include-package-data = false and package-data.find.include = [] do nothing as well.
Okay, I just stripped setuptools since the only thing I was using from it was the versioning, used the following instead:
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
This worked to exclude all the unnecessary files.
The only issue remaining now is that the Python packages don't get mapped to the right place. I do have the following, but it doesn't seem to work:
[tool.scikit-build.wheel.packages]
mlir_finch = "python_packages/finch/mlir_finch"
Version on GitHub is updated -- you'd need to force-pull.
I don't see a python_packages folder in the repo? Is that installed by CMake?
The wheel.packages is for discovering and installing Python files. CMake installs are not touched. You use wheel.install-dir to change where everything installs, but you can't move folders around - for that, you should instead edit python/CMakeLists.txt to change the install dir.
To close the loop on this:
if (DEFINED SKBUILD)
install(DIRECTORY "${MLIR_BINARY_DIR}/python_packages/finch/mlir_finch" DESTINATION "${SKBUILD_PLATLIB_DIR}" USE_SOURCE_PERMISSIONS)
endif()
Worked, alongside
wheel.exclude = ["**/*", "!mlir_finch/**/*"]
wheel.packages = []
Now to wrestle with Windows.