perf: add --version fast-path to skip full import chain

perf: add --version fast-path to skip full import chain
This commit is contained in:
Kevin Turcios 2026-04-09 04:50:14 -05:00 committed by GitHub
commit 07bd44db28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,6 +22,13 @@ if TYPE_CHECKING:
def main() -> None:
"""Entry point for the codeflash command-line interface."""
# Fast path: --version exits before importing the full stack
if len(sys.argv) == 2 and sys.argv[1] == "--version":
from codeflash.version import __version__
print(f"Codeflash version {__version__}")
return
from pathlib import Path
from codeflash.cli_cmds.cli import parse_args, process_pyproject_config