Skip to content
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

Beginner freindlyness #115

Open
famura opened this issue Nov 7, 2023 · 3 comments
Open

Beginner freindlyness #115

famura opened this issue Nov 7, 2023 · 3 comments

Comments

@famura
Copy link

famura commented Nov 7, 2023

Hi there, I found this repo when I was deciding on how to port some C++ code to python.

I used to go the way via described in the cmake_example, but after watching @henryiii 's talk from SciPy22 I thought about scikit_build_example would be worth a try.

However, I find it quite hard to understand what the (minimum) necessary components are and how this example works, especially since new/unknown/fancy tools like nox and ruff are used.
For example in this file a beginner wonders if the imports from future are necessary. Comments would be helpful there as well as in the CMakeLists.txt where one can not assume that beginners know where SKBUILD_PROJECT_NAME etc. come from.

Please don't get me wrong, I appreciate this project. I just think it needs a bit more documentation to be really usable for a broader audience

@district10
Copy link

district10 commented Nov 27, 2023

+1. I'll trying to migrate some of my binding projects from <pybind/cmake_example> to <pybind/scikit_build_example>. Before this, I can use the binding project like normal cmake project, but now I have no idea where PROJECT_BINARY_DIR is (So I can't configure vs-code's intellisense to use build/compile_commands.json, then I can't have any auto-completion, which is terrible).

@henryiii
Copy link
Collaborator

The very minimum is at https://scikit-build-core.readthedocs.io/en/latest/getting_started.html, which is just three files. This repo is a bit more, but still intended to be somewhat minimal, and scientific-python/cookie is "all the bells and whistles" (as described by and in sync with the accompanying development guide.

Open to specific suggestions! I can start by adding some comments.

@district10
Copy link

Thanks for quick reply. It works! For me, it's:

  1. add build-dir = "build" to pyproject.toml/[tool.scikit-build]
  2. use pip install --no-build-isolation --config-settings=editable.rebuild=true -ve. to build
  3. configure .vscode/c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Linux",
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json"
        }
    ],
    "version": 4
}

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

No branches or pull requests

3 participants