Open mcleantom opened 9 months ago
That temporary directory is removed by pip, so the path is there, it's just gone by the time vscode is looking for it. If you disable build isolation and install the dependencies manually, then the path should work.
Something like:
@nox.session(venv_backend="none")
def dev(session: nox.Session) -> None:
"""
Prepare a .venv folder.
"""
session.run(sys.executable, "-m", "venv", ".venv")
session.run(".venv/bin/pip", "install", "scikit-build-core[pyproject]", "pybind11")
session.run(
".venv/bin/pip",
"install",
"--no-build-isolation",
"--check-build-dependencies",
"-ve.",
"-Ccmake.define.CMAKE_EXPORT_COMPILE_COMMANDS=1",
"-Cbuild-dir=build",
)
That produces a /build
dir with compile commands in it that vscode can read when you run nox -s dev
.
(which cookiecutter template?)
@henryiii from https://github.com/scientific-python/cookie :)
I was wondering if you knew where to set the include path for pybind11 so that intellesense in vscode can find pybind11?
Pybind11 is found in a tempoary directory, so I dont know how I can add it's header files to my vscode C/C++ configuration:
(My project was bootstrapped using the cookiecutter template)