Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 911702

Summary: dev-python/contourpy-1.1.0 emerge fails with "error: 'kw_only' is not a member of 'py'"
Product: Gentoo Linux Reporter: dave.eckold
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED INVALID    
Severity: normal CC: ionen
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge log
emerge --info

Description dave.eckold 2023-08-04 08:46:19 UTC
contourpy fails to compile with an 4 identical errors (different lines) in wrap.cpp 

"error: 'kw_only' is not a member of 'py'"

Reproducible: Always

Steps to Reproduce:
emerge -u1 dev-python/contourpy
Actual Results:  
emerge fails

Expected Results:  
package should install
Comment 1 dave.eckold 2023-08-04 08:48:48 UTC
Created attachment 867004 [details]
emerge log

Error occurs line 81

../contourpy-1.1.0/src/wrap.cpp:196:18: error: ‘kw_only’ is not a member of ‘py’
  196 |              py::kw_only(),
      |                  ^~~~~~~
../contourpy-1.1.0/src/wrap.cpp:250:18: error: ‘kw_only’ is not a member of ‘py’
  250 |              py::kw_only(),
      |                  ^~~~~~~
../contourpy-1.1.0/src/wrap.cpp:310:18: error: ‘kw_only’ is not a member of ‘py’
  310 |              py::kw_only(),
      |                  ^~~~~~~
../contourpy-1.1.0/src/wrap.cpp:377:18: error: ‘kw_only’ is not a member of ‘py’
  377 |              py::kw_only(),
      |                  ^~~~~~~
Comment 2 dave.eckold 2023-08-04 08:49:59 UTC
Created attachment 867005 [details]
emerge --info
Comment 3 dave.eckold 2023-09-05 11:53:03 UTC
I created a test program to see if the issue is with pybind11.

The following program will fail to compile with the same error:

> #include <pybind11/pybind11.h>
> 
> namespace py = pybind11;
> 
> int add(int i, int j) {
>     return i + j;
> }
> 
> PYBIND11_MODULE(test_pybind, m) {
>     m.def("add", &add, "A function that adds.",
>             py::arg("i"), py::kw_only(), py::arg("j"));
> }

However, if I specify the compiler to include the site-package version of pybind11 using "-I/usr/lib/python3.11/site-packages/pybind11/include" it will compile. Even though the pybind11 in /usr/include and the site-package location are identical.

So this bug is probably not with contourpy, but somewhere further up.
Comment 4 Ionen Wolkens gentoo-dev 2023-09-05 12:20:33 UTC
You don't happen to have pybind11 includes somewhere else, right? Like in /usr/local/include that would likely take priority unless specify a -I
Comment 5 dave.eckold 2023-09-05 12:37:40 UTC
Looks like I installed FEniCS c. 4 years ago which added pybind11 to /usr/local/include........