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
This commit is contained in:
Andrej730
2024-05-09 13:35:29 +05:00
parent 4c8f93d737
commit 6e2edbf101
@@ -86,6 +86,18 @@ from .file import file
from .entity_instance import entity_instance, register_schema_attributes from .entity_instance import entity_instance, register_schema_attributes
from .sql import sqlite, sqlite_entity 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: try:
from .stream import stream, stream_entity from .stream import stream, stream_entity
except: except: