Skip to content

Project structure and bug fix#24

Open
Atraxus wants to merge 4 commits into
hz-b:mainfrom
Atraxus:main
Open

Project structure and bug fix#24
Atraxus wants to merge 4 commits into
hz-b:mainfrom
Atraxus:main

Conversation

@Atraxus

@Atraxus Atraxus commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Sorry @valentinstoecker for the larger rework. I tried to really make this stable for the future after I encountered a bug. Here is a summary of the changes, following online documentation:

Commit overview

76602b7 — src-layout + private _core + abi3 wheels

  • Package to src/rayx/, C++ to src/rayx_ext.cpp, one top-level CMake. [1][3]
  • Compiled module now private _core; __init__.py re-exports it. Fixes the unimportable-wheel bug. [1]
  • STABLE_ABI → one cp312-abi3 wheel; needs Development.SABIModule (CMake ≥3.26) + wheel.py-api="cp312". [2][4][6]
  • __init__.py cleanup: dynamic __all__, drop __name__ hack, no leaked Path.

61b7dc5 — public typing

  • py.typed marker. [7]
  • Hand-written __init__.pyi (native types come from generated _core.pyi). [2][7]
  • .gitignore !__init__.pyi so the stub ships (scikit-build-core is gitignore-aware). [5]

afe69fc — tests

  • New-layout tests + __all__-completeness guard.
  • test_stubs.py: fail if a helper is missing from the stub (stubtest too fragile with editable + generated stubs).

Sources

[1] https://nanobind.readthedocs.io/en/latest/packaging.html
[2] https://nanobind.readthedocs.io/en/latest/api_cmake.html
[3] https://github.com/wjakob/nanobind_example
[4] https://scikit-build-core.readthedocs.io/en/latest/configuration/index.html
[5] scikit-build-core build/_file_processor.py (each_unignored_file)
[6] https://cmake.org/cmake/help/latest/module/FindPython.html
[7] https://peps.python.org/pep-0561/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant