epics-base / pvaPy

pvaPy provides Python bindings for EPICS pvAccess
https://epics.anl.gov/extensions/pvaPy/production/index.html
Other
36 stars 23 forks source link

Type stubs missing #89

Open swelborn opened 5 months ago

swelborn commented 5 months ago

Hello! I am doing some development with pvaccess/pvapy, and I have found my IDE (vscode) cannot find the symbols associated with pvaccess:

image

I generated them using mypy:

pip install mypy
stubgen -m pvaccess
mv out/pvaccess.pyi /path/to/pvacess/site-packages/dir/

This fixes the issue (still unknown args, but better than having red lines everywhere in my IDE): image

swelborn commented 4 months ago

Want to note that you have to run the stubgen from within the site-packages dir

cd /path/to/pvaccess/
stubgen -m pvaccess
mv out/pvaccess.pyi .

So your dir should look like

~/.cache/pypoetry/virtualenvs/pva2hpc-NH_X-I2N-py3.11/lib/python3.11/site-packages/pvaccess$ ls
dbd  doc  __init__.py  lib  out  pvaccess.pyi  pvaccess.so  __pycache__