skia-python / skia-python/skia-python

Generate type stubs

Open
#133 4 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Jupyter Notebook
Stars
323
Forks
52
Avg merge
2h 29m
Merged PRs (30d)
1

Description

Is your feature request related to a problem? Please describe.
Intellisense/autocomplete doesn't work in Visual Studio Code when using Pylance as the language server.
It works when using Jedi or the Microsoft language server but it still has issues understanding the return types of functions.

Describe the solution you'd like
This is a known "issue" with Pylance, but they say it is a design choice. The solution should be to generate type stubs as discussed in this issue.
There is a discussion on how to automatically generate stubs for pybind11 here and the options seems to be either pybind11-stubgen or mypy's stubgen.

Describe alternatives you've considered
I could use a different LS such as Jedi but it's worse in general and there would still be issues.

Additional context

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 by reviewing the Pylance issue and the pybind11 stub-generation discussion linked in the report, then compare pybind11-stubgen with mypy's stubgen. Identify how stubs would be generated for this binding and verify that the resulting output provides Pylance autocomplete and function return types.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.