openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

Modules not being publically exported (Pyright)

Open diblaze opened this issue 3 years ago • 1 comments

Describe the bug Pyright will throw an error about imports not being publically exported.

To Reproduce Steps to reproduce the behavior:

  1. Generate an client
  2. Import a module from the client from test_client.models import test
  3. Pyright will throw an error "test" is not exported from module "test_client.models"

Expected behavior All public exports should be exported with a redudant alias. from .feature import Feature should be from .feature import Feature as Feature

Additional context Pyright will check imports in specific ways, which can be found here https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface.

Can also be fixed in the way issue https://github.com/openapi-generators/openapi-python-client/issues/540 suggested.

diblaze avatar Jun 10 '22 11:06 diblaze

I think this is a duplicate of

  • #540

But it's good to know that it's not just a mypy issue but also affects Pyright.

Edit: I see you also linked to #540. :)

johnthagen avatar Aug 04 '22 15:08 johnthagen

#676 fixes this 🥳

dbanty avatar Sep 26 '22 23:09 dbanty