From e753e928b7ec7b6b7d236f712ee86c0608ca96da Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Thu, 31 Oct 2024 16:41:58 -0500 Subject: [PATCH] perf: ape compile --help wasnt fast --- src/ape/cli/options.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ape/cli/options.py b/src/ape/cli/options.py index b2d7829440..88c715c040 100644 --- a/src/ape/cli/options.py +++ b/src/ape/cli/options.py @@ -1,4 +1,5 @@ import inspect +import sys from collections.abc import Callable from functools import partial from pathlib import Path @@ -528,6 +529,11 @@ def handle_parse_result(self, ctx, opts, args): def _project_callback(ctx, param, val): + if "--help" in sys.argv or "-h" in sys.argv: + # Perf: project option is eager; have to check sys.argv to + # know to exit early when only doing --help. + return + from ape.utils.basemodel import ManagerAccessMixin pm = None