Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Fix manylinux2014 warning not printing #7270

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/taichi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from taichi._funcs import *
from taichi._lib import core as _ti_core
from taichi._lib.utils import warn_restricted_version
from taichi._logging import *
from taichi._snode import *
from taichi.lang import * # pylint: disable=W0622 # TODO(archibate): It's `taichi.lang.core` overriding `taichi.core`
Expand Down Expand Up @@ -86,3 +87,6 @@ def __getattr__(attr):

del sys
del _ti_core

warn_restricted_version()
del warn_restricted_version
8 changes: 4 additions & 4 deletions python/taichi/_lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import platform
import re
import sys
import warnings

from colorama import Fore, Style

Expand Down Expand Up @@ -202,7 +203,9 @@ def try_get_loaded_libc_version():

def try_get_pip_version():
try:
import pip # pylint: disable=import-outside-toplevel
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import pip # pylint: disable=import-outside-toplevel
return tuple([int(v) for v in pip.__version__.split('.')])
except ImportError:
return None
Expand Down Expand Up @@ -244,6 +247,3 @@ def warn_restricted_version():
)
except Exception:
pass


warn_restricted_version()