-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Update to pybind11 2.6.0 #3305
Update to pybind11 2.6.0 #3305
Conversation
This includes changes to proper use of the generated config from the main pybind11 project. Since the layout of the files and their logic slightly changed in 2.6.0 these changes were required. The changes work for versions 2.5.0 and 2.4.3 as well. The test_package is adapted to resemble the corresponding test case https://github.com/pybind/pybind11/blob/master/tests/test_cmake_build/installed_target/CMakeLists.txt
All green in build 1 (
|
Huge thanks for bumping this project 🏆 I'm on mobile for forgive me if I didn't understand the PR. This PR is a huge help, I'll try to give some better pointers shortly if anything needs to be tweaked! |
I understand much better what you are trying to fix, however it does clash with on of the C3i rules, about CMake config files, see here. I've spent some times and I've sorted out (hopefully) the targets installed in two of the versions.
Their setup is mighty confusing. The installed CMake script in v2.6.0 also generates more targets...
Which should look familiar to the 2.5.0 targets 🤯 Another thing which I notices was the fact the CMake scripts which have helper functions have also moved around. |
Hey! Thank you for the quick and detailed review. Much appreciated! The guideline to not include a package config directly but instead model things correctly in Conan makes sense. I had a hard time with the new pybind11 version to follow this advice, though. I found this prior art on directly including a package config. Since I also did not see any absolute paths in the package config, I thought that I might get away with simply renaming the original package config as well. When I try to include
It seems that both the main Would modelling the targets defined in pybind11's cmakes with the Conan components feature help? I think these targets still need to be defined in exactly the same way as specified in the pybind11 project. I fear that this duplication is brittle and will make updating the package in the future more difficult. Since I am not an expert in neither CMake nor in Conan, I unfortunately need more help. How do I proceed from here? Thank you again for your pointers already! :) |
Yes!
#2803 is a good example, it will allow you to create the correct cmake targets. I suspect we will need to keep the config files (old and new) and yes we are allowed to rename them. I am no expert myself, so I think having a few extra minds on this might help. |
CMake wrapper shouldn't be removed, or if it is removed, |
os.rename("{}-{}".format(self.name, self.version), | ||
self._source_subfolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you restore all these changes based on length? CCI's .editorconfig allows 200 characters per line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the PR template I had to tick off "I've followed the PEP8 style guides for Python code in the recipes." In PEP8 it says 79 chars per line (and optionally up to 99 chars). I started using autopep8 in order to comply to this rule.
Do we have to change the PR template to reflect this? With which tool do I use an editorconfig file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length is indeed an exception to the rest of PEP8 style
See https://editorconfig.org for a list of editors with native support and a list of plugins for even more editors
self.cpp_info.build_modules = [get_path("FindPythonLibsNew.cmake"), | ||
get_path("pybind11Install.cmake")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't it be modeled with conan components? This block defeats CCI policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the docs, pybind11 exposes a lot of targets. https://pybind11.readthedocs.io/en/stable/compiling.html#advanced-interface-library-targets
Should all of these be modeled in the recipe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better. Those 2 custom cmake functions pybind11_strip()
and pybind11_extension()
are in pybind11Config.cmake
?
@@ -1,6 +1,7 @@ | |||
from conans import ConanFile, CMake, tools | |||
import os | |||
import sys | |||
from platform import python_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to be used.
Saw this PR which is related #1481 |
might resolve #2099 |
@kaihowl I tried to write a recipe on my own, but I'm stuck with my try to avoid auto generated cmake related files. See issue #3311 and my current fork state: https://github.com/andioz/conan-center-index/tree/master/recipes/pybind11. Maybe you can can find something useful. Over all, I think it is very difficult to avoid the cmake parts for this project, many tools depend on cmake within this projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add components later, let's update the version first.
All green in build 2 (
|
There this #3545 duplicate |
I detected other pull requests that are modifying pybind11 recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This includes changes to proper use of the generated config from the
main pybind11 project. Since the layout of the files and their logic
slightly changed in 2.6.0 these changes were required. The changes work
for versions 2.5.0 and 2.4.3 as well.
The test_package is adapted to resemble the corresponding test case
https://github.com/pybind/pybind11/blob/master/tests/test_cmake_build/installed_target/CMakeLists.txt
Specify library name and version: pybind11/2.6.0
conan-center hook activated.