Skip to content

Commit e0737b2

Browse files
authored
chore: use wheel tags command (#341)
* chore: use wheel tags command Signed-off-by: Henry Schreiner <[email protected]> * Update build.yml --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 4ab8950 commit e0737b2

File tree

5 files changed

+17
-221
lines changed

5 files changed

+17
-221
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
run: |
185185
sudo apt-get update
186186
sudo apt-get install -y --no-install-recommends libssl-dev
187-
pip install -r requirements-dev.txt
187+
pip install -r requirements-test.txt
188188
189189
- uses: actions/download-artifact@v3
190190
with:

requirements-repair.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
wheel<0.38
2-
wheeltools @ git+https://github.com/jcfr/wheeltools.git@wheeltools-2018-10-28-a2f174d0e#egg=wheeltools
1+
wheel>=0.40.0

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ pytest-virtualenv>=1.7.0
99
scikit-build>=0.10.0
1010
setuptools>=28.0.0
1111
virtualenv>=15.0.3
12-
wheel<0.38
12+
wheel

scripts/convert_to_generic_platform_wheel.py

Lines changed: 0 additions & 208 deletions
This file was deleted.

scripts/repair_wheel.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import tempfile
1010
from pathlib import Path
1111

12-
from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
13-
1412

1513
def main():
1614
if sys.platform.startswith("linux"):
@@ -55,9 +53,11 @@ def main():
5553
shutil.copyfile(file, tmpdir / file.name)
5654
(file,) = tmpdir.glob("*.whl")
5755

58-
# we need to handle macOS universal2 & arm64 here for now, let's use additional_platforms for this.
59-
additional_platforms = []
56+
# we need to handle macOS universal2 & arm64 here for now, let's use platform_tag_args for this.
57+
platform_tag_args = []
6058
if os_ == "macos":
59+
additional_platforms = []
60+
6161
# first, get the target macOS deployment target from the wheel
6262
match = re.match(r"^.*-macosx_(\d+)_(\d+)_x86_64\.whl$", file.name)
6363
assert match is not None
@@ -77,13 +77,18 @@ def main():
7777
# They're were also issues with pip not picking up some universal2 wheels, tag twice
7878
additional_platforms.append("macosx_11_0_universal2")
7979

80+
platform_tag_args = [f"--platform-tag=+{'.'.join(additional_platforms)}"]
81+
8082
# make this a py2.py3 wheel
81-
convert_to_generic_platform_wheel(
82-
str(file),
83-
out_dir=str(wheelhouse),
84-
py2_py3=True,
85-
additional_platforms=additional_platforms,
83+
subprocess.run(
84+
["wheel", "tags", "--python-tag", "py2.py3", "--abi-tag", "none", *platform_tag_args, "--remove", str(file)],
85+
check=True,
86+
stdout=subprocess.PIPE,
8687
)
88+
files = list(tmpdir.glob("*.whl"))
89+
assert len(files) == 1, files
90+
file = files[0]
91+
file.rename(wheelhouse / file.name)
8792

8893

8994
if __name__ == "__main__":

0 commit comments

Comments
 (0)