Skip to content

Commit

Permalink
[misc] Keeping up with new python-wheel implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
feisuzhu committed Dec 26, 2022
1 parent 1763ca1 commit 574ea3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/taichi/_lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ def _print_taichi_header():

def try_get_wheel_tag(module):
try:
import wheel.metadata # pylint: disable=import-outside-toplevel
from email.parser import \
Parser # pylint: disable=import-outside-toplevel
wheel_path = f'{module.__path__[0]}-{".".join(map(str, module.__version__))}.dist-info/WHEEL'
meta = wheel.metadata.read_pkg_info(wheel_path)
with open(wheel_path, 'r') as f:
meta = Parser().parse(f)
return meta.get('Tag')
except Exception:
return None
Expand Down

0 comments on commit 574ea3a

Please sign in to comment.