Skip to content

Commit 0a8386f

Browse files
committed
convert_to_generic_platform_wheel: Remove auditwheel dependency, use wheeltools
1 parent 1240bd2 commit 0a8386f

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Diff for: requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ setuptools>=28.0.0
1111
twine
1212
virtualenv>=15.0.3
1313
wheel
14+
wheeltools

Diff for: scikit-ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ install:
2626
commands:
2727
- python -c "import sys; print(sys.version)"
2828
- python -m pip install --disable-pip-version-check --upgrade pip
29-
- python -m pip install auditwheel
3029
- pip install pytest-virtualenv -f https://github.com/jcfr/pytest-plugins/releases/tag/v1.7.0.dev15 --pre
3130
- pip install -r requirements-dev.txt
3231

Diff for: scripts/convert_to_generic_platform_wheel.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11

22
import argparse
3+
import glob
34
import logging
45
import os
56
import sys
67

78
from itertools import product
89
from os.path import (abspath, basename, dirname, isfile, join as pjoin, splitext)
910

10-
from auditwheel.tools import unique_by_index
11-
from auditwheel.wheeltools import _dist_info_dir, InWheelCtx
1211
from wheel.pkginfo import read_pkg_info, write_pkg_info
1312
from wheel.install import WHEEL_INFO_RE
13+
from wheeltools.tools import unique_by_index
14+
from wheeltools.wheeltools import InWheelCtx, WheelToolsError
1415

1516
logger = logging.getLogger(splitext(basename(__file__))[0])
1617

1718

19+
def _dist_info_dir(bdist_dir):
20+
"""Get the .dist-info directort from an unpacked wheel
21+
22+
Parameters
23+
----------
24+
bdist_dir : str
25+
Path of unpacked wheel file
26+
"""
27+
28+
info_dirs = glob.glob(pjoin(bdist_dir, '*.dist-info'))
29+
if len(info_dirs) != 1:
30+
raise WheelToolsError("Should be exactly one `*.dist_info` directory")
31+
return info_dirs[0]
32+
33+
1834
def _to_generic_pyver(pyver_tags):
1935
"""Convert from CPython implementation to generic python version tags
2036
@@ -44,7 +60,7 @@ def _convert_to_generic_platform_wheel(wheel_ctx):
4460

4561
abi_tags = ['none']
4662

47-
info_fname = pjoin(_dist_info_dir(wheel_ctx.path), 'WHEEL')
63+
info_fname = pjoin(_dist_info_dir(wheel_ctx.wheel_path), 'WHEEL')
4864
info = read_pkg_info(info_fname)
4965

5066
# Check what tags we have

0 commit comments

Comments
 (0)