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

Fix obsolete wheel usage in addtag #226

Merged
merged 2 commits into from
Feb 12, 2020
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: 2 additions & 2 deletions auditwheel/main_addtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def configure_parser(sub_parsers):

def execute(args, p):
import os
from wheel.install import WHEEL_INFO_RE # type: ignore
from wheel.wheelfile import WHEEL_INFO_RE # type: ignore
from .wheeltools import InWheelCtx, add_platforms, WheelToolsError
from .wheel_abi import analyze_wheel_abi

wheel_abi = analyze_wheel_abi(args.WHEEL_FILE)

parsed_fname = WHEEL_INFO_RE(basename(args.WHEEL_FILE))
parsed_fname = WHEEL_INFO_RE.search(basename(args.WHEEL_FILE))
in_fname_tags = parsed_fname.groupdict()['plat'].split('.')

logger.info('%s receives the following tag: "%s".',
Expand Down
12 changes: 12 additions & 0 deletions tests/integration/test_addtag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from unittest.mock import Mock
from pathlib import Path

from auditwheel.main_addtag import execute

HERE = Path(__file__).parent.resolve()

def test_smoke(tmpdir):
"""Simple test to exercise the 'addtag' code path"""
args = Mock(WHEEL_FILE=str(HERE / "cffi-1.5.0-cp27-none-linux_x86_64.whl"),
WHEEL_DIR=str(tmpdir / "wheelhouse/"))
execute(args, None)