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] Keeping up with new python-wheel implementation #6986

Merged
merged 1 commit into from
Dec 26, 2022
Merged
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
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