Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inquirer.py is not properly exporting functions #48

Closed
Sofahamster opened this issue Aug 5, 2022 · 1 comment · Fixed by #52
Closed

inquirer.py is not properly exporting functions #48

Sofahamster opened this issue Aug 5, 2022 · 1 comment · Fixed by #52

Comments

@Sofahamster
Copy link

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
Copy link

wabiloo commented Mar 24, 2023

Strange, I'm still seeing it...

brody4hire pushed a commit to brody4hire/InquirerLib that referenced this issue Jan 16, 2024
Including some proposed & unpublished updates from InquirerPy:

- kazhala/InquirerPy#69 - fix typos
- kazhala/InquirerPy#65 - add DataValidator class
- kazhala/InquirerPy#56 - add Choice.instruction field
- kazhala/InquirerPy#52 - proper exporting of functions ref:
  - kazhala/InquirerPy#60
  - kazhala/InquirerPy#48

also document some info to address issue: kazhala/InquirerPy#64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants