Skip to content

Commit

Permalink
[misc] Add flag to disable taichi header print (taichi-dev#8413)
Browse files Browse the repository at this point in the history
Issue: taichi-dev#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.

<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at 65548e0</samp>

Add an option to disable Taichi header printing using an environment
variable. Modify `python/taichi/_lib/utils.py` to implement the option.

### Walkthrough

<!--
copilot:walkthrough
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at 65548e0</samp>

* 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>
  • Loading branch information
chaoming0625 and pre-commit-ci[bot] authored Nov 27, 2023
1 parent 2fd2449 commit 59156b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/taichi/_lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 59156b3

Please sign in to comment.