-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake config and args sections (and maybe more) in py-build-cmake.local.toml does not seem to apply #27
Comments
Ok so it does work when running |
I'll have a more detailed look later, but I suspect that the issue is that PyPA build first creates an sdist. Then it extracts all source code from the sdist in a separate environment, and then does the main build. By default, your local config file is not included in the sdist, so it will not be considered when PyPA build builds the main wheel from the sdist. I don't think automatically including these config files in the sdist is a good idea (they're meant to be local, after all), but py-build-cmake should at least warn about this, though. To skip the sdist step, you can use |
That would make sense.
Ultimately the goal here is to deal with a library dependency for the binary bundled in the wheel on different platforms and on e.g windows there is a need to confige paths for that. |
The problem here is that PyPA build changes the current working directory to its own temporary build directory. So by the time py-build-cmake receives
In an ideal world, you'd use a package manager like Conan or vcpkg for this purpose. You could also add a CMake Find module to your project, but that's usually more work to maintain. |
Yeah the reason I was trying to pass in a config in the first place was specify the vcpkg toolchain location and tell vcpkg to use the static triplet instead of the default one to avoid having to deal with dlls. In any case I can still put that in the cmake file for now. |
I'm trying to set up a project to build a binary with py-build-cmake and need to pass some options via a config file depending on system but anything I add to args and config in the py-build-cmake.local.toml do not seem to have any effect. If I change source_path it does however so the config is clearly being parsed. It works fine if I put the same options in pyproject.toml. Same happens on both ubuntu 24.04 and windows 10 with python 3.12. I couldn't figure out if there was a way to load a different config file when running
py -m build
and runningpy-build-cmake
manually just fails withError: /home/___/___/___/minimal-program/.py-build-cmake_cache/cp312-cp312-linux_x86_64 is not a directory
(or doesn't do anything meaningful and just skips the build process if there is an existing build already)Not sure if it's in any way related but the build env also complains about
/tmp/build-env-z_d23dbe/lib/python3.12/site-packages/py_build_cmake/config_options.py:510: SyntaxWarning: invalid escape sequence '\|'
The text was updated successfully, but these errors were encountered: