pybind / pybind/scikit_build_example

vscode pylance support

Open
#158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
148
Forks
39
Avg merge
8d 2h
Merged PRs (30d)
1

Description

Hi @henryiii , I'm wondering how to let vscode-pylance understand how to import the c++ module? what is the most elagant way of doing it? I put xx.pyi in the corresponding folder, yet pylance still cannot import. I can manually copy the built xx.cpython-310-x86_64-linux-gnu.so file, but this is ugly. I can also update some vscode option but then I need to fix the built xx.so file location and this is also ugly. Could you make an exmaple in this boilplate project?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the boilerplate project and reproduce the VS Code/Pylance import issue, then inspect how xx.pyi and the built xx.cpython-310-x86_64-linux-gnu.so are placed. Done means the example demonstrates a setup that Pylance can import without manually copying the .so file or changing VS Code paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, vscode
Domain
build-system, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.