Commit d7b6699
committed
int(python): unify pybind11 and nanobind into single-source bindings
Remove the parallel src/python-nanobind/ tree and compile one set of
binding sources per build, selected by OIIO_PYTHON_BINDINGS_BACKEND
(pybind11 or nanobind; drop the "both" mode).
Add py_backend.h with namespace py = pybind11|nanobind and small
oiio_py:: helpers/macros only where the APIs differ. Migrate roi,
typedesc, imagespec, and paramvalue to dual-backend declare_* sources;
fold the former py_oiio_nb helpers and partial module init into
py_oiio.h / py_oiio.cpp behind #if OIIO_PY_BACKEND_NANOBIND.
Install nanobind modules into the same site-packages/OpenImageIO tree
as pybind11 (no separate nanobind package or duplicate tests). Update
CMake, CI, and INSTALL.md accordingly; move MIGRATION_STATUS.md into
src/python/.
Materialize string_view returns as std::string in py_imagespec.cpp so
nanobind can convert them to Python str.
Assisted-by: Cursor / Auto
Signed-off-by: Aleksandr Motsjonov <soswow@gmail.com>1 parent 83fb484 commit d7b6699
23 files changed
Lines changed: 1055 additions & 1938 deletions
File tree
- .github/workflows
- src
- cmake
- python-nanobind
- python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
| 688 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 317 | + | |
323 | 318 | | |
324 | 319 | | |
325 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
| |||
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
| 261 | + | |
263 | 262 | | |
264 | 263 | | |
265 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | | - | |
| 17 | + | |
20 | 18 | | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
23 | 21 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 22 | | |
37 | 23 | | |
38 | 24 | | |
| |||
79 | 65 | | |
80 | 66 | | |
81 | 67 | | |
82 | | - | |
| 68 | + | |
83 | 69 | | |
84 | 70 | | |
85 | 71 | | |
| |||
232 | 218 | | |
233 | 219 | | |
234 | 220 | | |
235 | | - | |
| 221 | + | |
236 | 222 | | |
237 | 223 | | |
238 | 224 | | |
| |||
264 | 250 | | |
265 | 251 | | |
266 | 252 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 253 | + | |
270 | 254 | | |
271 | 255 | | |
272 | | - | |
273 | | - | |
274 | 256 | | |
275 | | - | |
276 | | - | |
| 257 | + | |
| 258 | + | |
277 | 259 | | |
278 | 260 | | |
279 | 261 | | |
280 | | - | |
281 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
282 | 267 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | 268 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | 250 | | |
253 | 251 | | |
254 | | - | |
| 252 | + | |
255 | 253 | | |
256 | 254 | | |
257 | | - | |
| 255 | + | |
258 | 256 | | |
259 | 257 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
| 258 | + | |
269 | 259 | | |
270 | 260 | | |
271 | 261 | | |
| |||
279 | 269 | | |
280 | 270 | | |
281 | 271 | | |
282 | | - | |
| 272 | + | |
283 | 273 | | |
284 | | - | |
285 | 274 | | |
286 | 275 | | |
287 | 276 | | |
288 | | - | |
| 277 | + | |
289 | 278 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 279 | + | |
295 | 280 | | |
296 | | - | |
297 | | - | |
298 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
299 | 286 | | |
300 | 287 | | |
301 | 288 | | |
| |||
317 | 304 | | |
318 | 305 | | |
319 | 306 | | |
320 | | - | |
| 307 | + | |
321 | 308 | | |
322 | 309 | | |
323 | 310 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments