From 59156b3c1d35be715793603b3d4d23d70527fbaa Mon Sep 17 00:00:00 2001 From: Chaoming Wang Date: Mon, 27 Nov 2023 17:08:40 +0800 Subject: [PATCH] [misc] Add flag to disable taichi header print (#8413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: #8334 ### Brief Summary Add a flag to disable Taichi header print. One can set ``os.environ['ENABLE_TAICHI_HEADER_PRINT'] = False`` to disable the header print. ### 🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset) Generated by Copilot at 65548e0 Add an option to disable Taichi header printing using an environment variable. Modify `python/taichi/_lib/utils.py` to implement the option. ### Walkthrough ### 🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset) Generated by Copilot at 65548e0 * Add a conditional check to enable or disable the Taichi header printing ([link](https://github.com/taichi-dev/taichi/pull/8413/files?diff=unified&w=0#diff-46daba8967b07b778d2090c80d91720ba234f327d62bc475b2fb956c9f04223dL172-R173)) * Use an environment variable `ENABLE_TAICI_HEADER_PRINT` to control the check ([link](https://github.com/taichi-dev/taichi/pull/8413/files?diff=unified&w=0#diff-46daba8967b07b778d2090c80d91720ba234f327d62bc475b2fb956c9f04223dL172-R173)) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- python/taichi/_lib/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/taichi/_lib/utils.py b/python/taichi/_lib/utils.py index af11a1da71523..3f2add67e1edb 100644 --- a/python/taichi/_lib/utils.py +++ b/python/taichi/_lib/utils.py @@ -169,7 +169,8 @@ def _print_taichi_header(): print(header) -_print_taichi_header() +if os.environ.get("ENABLE_TAICHI_HEADER_PRINT", True): + _print_taichi_header() def try_get_wheel_tag(module):