Search code examples
pythonpylance

Why does Visual Studio Code/Python not show the docstring for functions from my PyPI package?


I have recently created my own PyPI package with a bunch of useful functions. It works great, and when I import it in any project, the functions work, but my Visual Studio Code doesn't show the docstrings when I hover over the functions, and the functions stay white.

Are there Python Visual Studio Code settings I need to change or things I need to change in my PyPI package?

enter image description here

The GitHub place for jeffutils.

I have tried setting the "python.analysis.packageIndexDepths" depth for "jeffutils" to 4, and I added from .utils import * into the __init__.py file in the package.

Other than that, I am kind of lost, since Pylance and the Python interpreter will pop up docstrings for all of the other pip-installed packages I have.


Solution

  • Following InSync's advice, I compared my Pylance and Python extensions settings with the settings in GitHub Codespaces.

    I made sure everything matched up the same. The things I recall changing was getting rid of my PythonAnalysis:Extra Paths (I had paths to a couple of Python binary files on my CPU), and then pip uninstalling and reinstalling the jeffutils package.

    I wish I knew what fixed the problem, but following InSync's advice worked!