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

ci: Fix interface scan omits types (e.g., ConnectorResourceReference) #2880

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bin/public_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def _scan_variables_in_module(self, module_name: str) -> None:
There is no method to verify if a module attribute is a constant,
After some experiment, here we assume if an attribute is a value
(without `__module__`) and not a module itself is a constant.

Note: Class (and other types) should be treated as a variable too
"""
for constant_name, _ in inspect.getmembers(
importlib.import_module(module_name),
Expand All @@ -61,6 +63,13 @@ def _scan_variables_in_module(self, module_name: str) -> None:
full_path = f"{module_name}.{constant_name}"
self.variables.add(full_path)

for class_name, _class in inspect.getmembers(importlib.import_module(module_name), inspect.isclass):
# Skip imported and ones starting with "_"
if _class.__module__ != module_name or class_name.startswith("_"):
continue
full_path = f"{module_name}.{class_name}"
self.variables.add(full_path)

def _scan_classes_in_module(self, module_name: str) -> None:
for class_name, _class in inspect.getmembers(importlib.import_module(module_name), inspect.isclass):
# Skip imported and ones starting with "_"
Expand Down