MCPcopy Create free account
hub / github.com/FastLED/FastLED / main

Function main

ci/ci-compile.py:107–431  ·  view source on GitHub ↗

Main function.

()

Source from the content-addressed store, hash-verified

105
106
107def main() -> int:
108 """Main function."""
109 # WASM fast path: bypass full argument parser + heavy imports (~150ms saved)
110 wasm_rc = _wasm_fast_path()
111 if wasm_rc is not None:
112 return wasm_rc
113
114 # Non-WASM path: load stdlib + heavy imports (~25ms + ~350ms)
115 import time
116 from pathlib import Path
117 from typing import Optional
118
119 from ci.util.global_interrupt_handler import install_signal_handler
120
121 install_signal_handler()
122
123 # Parse arguments using new CompilationArgumentParser
124 from ci.compiler.argument_parser import CompilationArgumentParser, WorkflowType
125
126 # Compilation Docker has been decommissioned (#2812). Project root is
127 # always derived from this file's location.
128 project_root = Path(__file__).parent.parent.absolute()
129 parser = CompilationArgumentParser(project_root)
130
131 # First check if --supported-boards was requested before full parsing
132 if "--supported-boards" in sys.argv:
133 from ci.compiler.board_example_utils import get_default_boards
134
135 print(",".join(get_default_boards()))
136 return 0
137
138 config = parser.parse()
139
140 # Handle verbose mode
141 if config.verbose:
142 os.environ["VERBOSE"] = "1"
143
144 # Handle default boards if none specified
145 if not config.boards:
146 from ci.boards import Board, create_board
147 from ci.compiler.board_example_utils import get_default_boards
148
149 board_names = get_default_boards()
150 boards: list[Board] = []
151 for board_name in board_names:
152 try:
153 board = create_board(board_name, no_project_options=False)
154 boards.append(board)
155 except KeyboardInterrupt as ki:
156 from ci.util.global_interrupt_handler import handle_keyboard_interrupt
157
158 handle_keyboard_interrupt(ki)
159 raise
160 except Exception as e:
161 print(f"ERROR: Failed to get board '{board_name}': {e}")
162 return 1
163 # Create new config with default boards
164 from ci.compiler.argument_parser import CompilationConfig

Callers 1

ci-compile.pyFile · 0.70

Calls 15

parseMethod · 0.95
install_signal_handlerFunction · 0.90
get_default_boardsFunction · 0.90
create_boardFunction · 0.90
CompilationConfigClass · 0.90
resolve_example_pathFunction · 0.90
validate_output_pathFunction · 0.90
yellow_textFunction · 0.90
compile_board_examplesFunction · 0.90
red_textFunction · 0.90

Tested by

no test coverage detected