Skip to content

VSCode pylance raised reportPrivateImportUsage error. #675

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

Closed
EltonChou opened this issue Sep 26, 2022 · 1 comment · Fixed by #676
Closed

VSCode pylance raised reportPrivateImportUsage error. #675

EltonChou opened this issue Sep 26, 2022 · 1 comment · Fixed by #676
Labels
🐞bug Something isn't working
Milestone

Comments

@EltonChou
Copy link
Contributor

EltonChou commented Sep 26, 2022

Describe the bug
In vscode,
current templates will cause pylance to raises the reportPrivateImportUsage.

To Reproduce

try.py

from the_client import AuthenticatedClient
from the_client.api.the_tag import get_stuff
from the_client.models import Stuff

pylance message:

"AuthenticatedClient" is not exported from module "the_client"
 Import from "the_client.client" instead
"Stuff" is not exported from module "the_client.models"
 Import from "the_client.models.stuff" instead`

Expected behavior
The class should be imported without any error message.
It can be fixed by adding __all__ symbol to solve this issue.
ref: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface

OpenAPI Spec File
Not related to OpenAPI spec.

Desktop (please complete the following information):

  • OS: win10
  • Python Version: 3.10
  • openapi-python-client version 0.11.6

Additional context
Add any other context about the problem here.

@EltonChou EltonChou added the 🐞bug Something isn't working label Sep 26, 2022
@dbanty
Copy link
Collaborator

dbanty commented Sep 26, 2022

Relates to #631 & #540 I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants