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

Client, APIException and HCloudException not properly exported #345

Closed
jkreileder opened this issue Dec 22, 2023 · 0 comments · Fixed by #346
Closed

Client, APIException and HCloudException not properly exported #345

jkreileder opened this issue Dec 22, 2023 · 0 comments · Fixed by #346

Comments

@jkreileder
Copy link
Contributor

Bug Report

Client, APIException and HCloudException are not properly exported which makes pyright reportPrivateImportUsage.

$ grep "from hcloud" cf_ips_to_hcloud_fw/__main__.py
from hcloud import APIException, Client
from hcloud.firewalls.domain import Firewall, FirewallRule
$ venv/bin/pyright --venvpath .
cf-ips-to-hcloud-fw/cf_ips_to_hcloud_fw/__main__.py
  cf-ips-to-hcloud-fw/cf_ips_to_hcloud_fw/__main__.py:9:20 - error: "APIException" is not exported from module "hcloud"
    Import from "hcloud._exceptions" instead (reportPrivateImportUsage)
  cf-ips-to-hcloud-fw/cf_ips_to_hcloud_fw/__main__.py:9:34 - error: "Client" is not exported from module "hcloud"
    Import from "hcloud._client" instead (reportPrivateImportUsage)
2 errors, 0 warnings, 0 informations 

Environment

  • Python Version: 3.11
  • Hcloud-Python Version: v1.33.0

Possible Solution

Either include them in an __all__ list or export them with a redundant aliased import.
(See https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface)

jooola pushed a commit that referenced this issue Jan 2, 2024
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.

1 participant