kazhala / InquirerPy

:snake: Python port of Inquirer.js (A collection of common interactive command-line user interfaces)
https://inquirerpy.readthedocs.io
MIT License
357 stars 19 forks source link

inquirer.py is not properly exporting functions #48

Closed Sofahamster closed 1 year ago

Sofahamster commented 2 years ago

Pylance in VS Code is reporting "incorrect usage of symbol imported from a "py.typed" module that is [not re-exported]".

Example code:

from InquirerPy import inquirer
_ = inquirer.text("Example:")

Reported error:

"text" is not exported from module "test.inquirer" Pylance(reportPrivateImportUsage)

This can be fixed by adding __all__ to inquirer.py:

from InquirerPy.prompts import CheckboxPrompt as checkbox
from InquirerPy.prompts import ConfirmPrompt as confirm
from InquirerPy.prompts import ExpandPrompt as expand
from InquirerPy.prompts import FilePathPrompt as filepath
from InquirerPy.prompts import FuzzyPrompt as fuzzy
from InquirerPy.prompts import InputPrompt as text
from InquirerPy.prompts import ListPrompt as select
from InquirerPy.prompts import NumberPrompt as number
from InquirerPy.prompts import RawlistPrompt as rawlist
from InquirerPy.prompts import SecretPrompt as secret

__all__ = ['select', 'text', 'secret', 'rawlist', 'confirm', 'checkbox', 'expand', 'filepath', 'fuzzy', 'number']

Without the "all", every function all is marked as a problem.

wabiloo commented 1 year ago

Strange, I'm still seeing it...