From 6e2edbf101d7a62a9bd428133f675c451599a6f9 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 9 May 2024 13:35:29 +0500 Subject: [PATCH] explicitly specify available imported symbols Fix LSP warnings like ""entity_instance" is not exported from module "ifcopenshell"PylancereportPrivateImportUsage" for `ifcopenshell.file`, `ifcopenshell.entity_instance` etc. After adding py.typed in 722201a1a it's now a typed library and all imported symbols in modules are considered private by default and should be added to `__all__` if they are supposed to be generally available from imported module. See https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface --- src/ifcopenshell-python/ifcopenshell/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index 739e99bbc6..ea695fed78 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -86,6 +86,18 @@ from .file import file from .entity_instance import entity_instance, register_schema_attributes from .sql import sqlite, sqlite_entity +# explicitly specify available imported symbols +# (it's a requirement for a typed library) +__all__ = [ + "ifcopenshell_wrapper", + "file", + "entity_instance", + "sqlite", + "sqlite_entity", + "stream", + "stream_entity", +] + try: from .stream import stream, stream_entity except: