()
| 567 | |
| 568 | |
| 569 | def main(): |
| 570 | griffe_module = load_griffe() |
| 571 | |
| 572 | print("Starting Python SDK documentation generation...\n") |
| 573 | print(f"Output: {OUTPUT_DIR}\n") |
| 574 | |
| 575 | # Clean output |
| 576 | if OUTPUT_DIR.exists(): |
| 577 | shutil.rmtree(OUTPUT_DIR) |
| 578 | OUTPUT_DIR.mkdir(parents=True) |
| 579 | |
| 580 | # Load package |
| 581 | print("Loading composio package...") |
| 582 | try: |
| 583 | package = griffe_module.load("composio", search_paths=[str(PACKAGE_DIR)]) |
| 584 | except Exception as e: |
| 585 | print(f"Error: {e}") |
| 586 | raise SystemExit(1) |
| 587 | |
| 588 | # Find Composio class |
| 589 | composio_cls = package.members["sdk"].members["Composio"] |
| 590 | print(" Found Composio class") |
| 591 | |
| 592 | # Discover classes from EXPECTED_CLASSES |
| 593 | classes_to_doc = {"Composio": {"cls": composio_cls, "access": None, "prop": None}} |
| 594 | prop_to_class = {} # Maps property name -> class name |
| 595 | |
| 596 | for module_name in CLASS_MODULES: |
| 597 | try: |
| 598 | parts = module_name.split(".") |
| 599 | current = package |
| 600 | for part in parts: |
| 601 | current = current.members[part] |
| 602 | |
| 603 | # Find expected classes in this module |
| 604 | for class_name, prop_name in EXPECTED_CLASSES.items(): |
| 605 | if class_name in current.members: |
| 606 | cls = current.members[class_name] |
| 607 | if isinstance(cls, griffe_module.Class): |
| 608 | classes_to_doc[class_name] = { |
| 609 | "cls": cls, |
| 610 | "access": f"composio.{prop_name}", |
| 611 | "prop": prop_name, |
| 612 | } |
| 613 | prop_to_class[prop_name] = class_name |
| 614 | print(f" Found {class_name} (via composio.{prop_name})") |
| 615 | except (KeyError, AttributeError): |
| 616 | continue |
| 617 | |
| 618 | # Add standalone public-facing classes that are not surfaced via a direct |
| 619 | # ``composio.<property>`` access pattern. |
| 620 | for class_name, module_name in ADDITIONAL_CLASSES.items(): |
| 621 | try: |
| 622 | parts = module_name.split(".") |
| 623 | current = package |
| 624 | for part in parts: |
| 625 | current = current.members[part] |
| 626 |
no test coverage detected
searching dependent graphs…