Skip to content

Commit 9044a12

Browse files
authored
Merge pull request #23 from karellen/issue_22
Fix `bdist_wheel` migrating into `setuptools`
2 parents 4ef8b30 + 2b01bc0 commit 9044a12

File tree

4 files changed

+52
-38
lines changed

4 files changed

+52
-38
lines changed

.github/workflows/build.yml

+24-36
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,31 @@ jobs:
2020
- '3.12'
2121
- '3.11'
2222
- '3.10'
23-
- '3.9'
2423
pip-version:
24+
- '24.2'
2525
- '24.1'
2626
- '24.0'
2727
- '23.3'
2828
- '22.3'
2929
setuptools-version:
30-
- '70.1'
31-
- '70.0'
30+
- '72.1'
31+
- '71.1'
32+
- '70.3'
3233
- '69.5'
3334
- '68.2'
34-
- '67.0'
35-
- '66.0'
36-
- '65.0'
35+
- '67.8'
36+
- '66.1'
37+
- '65.7'
3738
exclude:
3839
- python-version: '3.12'
39-
setuptools-version: '65.0'
40-
- python-version: '3.12'
41-
pip-version: '22.2'
40+
setuptools-version: '65.7'
4241
- python-version: '3.12'
4342
pip-version: '22.3'
4443
env:
4544
DEPLOY_PYTHONS: "3.12"
4645
DEPLOY_OSES: "Linux"
47-
DEPLOY_PIPS: "24.0"
48-
DEPLOY_SETUPTOOLS: "70.0"
46+
DEPLOY_PIPS: "24.2"
47+
DEPLOY_SETUPTOOLS: "72.1"
4948
TWINE_USERNAME: __token__
5049
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
5150
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -74,6 +73,7 @@ jobs:
7473
python-version: ${{ matrix.python-version }}
7574
pyb-extra-args: ${{ env.PYB_EXTRA_ARGS }}
7675
build-secondary:
76+
needs: 'build-primary'
7777
runs-on: ${{ matrix.os }}
7878
continue-on-error: false
7979
strategy:
@@ -83,39 +83,26 @@ jobs:
8383
- ubuntu-latest
8484
- macos-13
8585
python-version:
86+
- '3.9'
8687
- '3.8'
87-
- '3.7'
8888
pip-version:
89+
- '24.2'
8990
- '24.1'
9091
- '24.0'
9192
- '23.3'
9293
- '22.3'
9394
setuptools-version:
94-
- '70.1'
95-
- '70.0'
95+
- '72.1'
96+
- '71.1'
97+
- '70.3'
9698
- '69.5'
9799
- '68.2'
98-
- '68.1'
99-
- '68.0'
100-
- '67.0'
101-
- '66.0'
102-
- '65.0'
100+
- '67.8'
101+
- '66.1'
102+
- '65.7'
103103
- '64.0'
104-
- '63.0'
105-
- '62.0'
106-
exclude:
107-
- python-version: '3.7'
108-
setuptools-version: '68.2'
109-
- python-version: '3.7'
110-
setuptools-version: '68.1'
111-
- python-version: '3.7'
112-
setuptools-version: '69.5'
113-
- python-version: '3.7'
114-
setuptools-version: '70.0'
115-
- python-version: '3.7'
116-
setuptools-version: '70.1'
117-
- python-version: '3.7'
118-
pip-version: '24.1'
104+
- '63.4'
105+
- '62.6'
119106
env:
120107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121108
steps:
@@ -133,6 +120,7 @@ jobs:
133120
python-version: ${{ matrix.python-version }}
134121
pyb-extra-args: ${{ env.PYB_EXTRA_ARGS }}
135122
build-experimental:
123+
needs: 'build-primary'
136124
runs-on: ${{ matrix.os }}
137125
continue-on-error: true
138126
strategy:
@@ -144,9 +132,9 @@ jobs:
144132
python-version:
145133
- '3.13-dev'
146134
pip-version:
147-
- '24.1'
135+
- '24.2'
148136
setuptools-version:
149-
- '70.1'
137+
- '72.1'
150138
env:
151139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152140
steps:

.idea/misc.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/integrationtest/python/build_axle_tests.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@
2525
from subprocess import check_call
2626
from tempfile import TemporaryDirectory
2727

28-
from wheel.bdist_wheel import get_abi_tag, get_platform, tags
28+
try:
29+
# SetupTools >= 70.1
30+
from setuptools.command.bdist_wheel import get_abi_tag, get_platform, tags
31+
except ImportError:
32+
try:
33+
# Wheel >= 0.44.0
34+
from wheel._bdist_wheel import get_abi_tag, get_platform, tags
35+
except ImportError:
36+
# Wheel < 0.44.0
37+
from wheel.bdist_wheel import get_abi_tag, get_platform, tags
2938

3039

3140
class BuildAxleTest(unittest.TestCase):

src/main/python/wheel_axle/bdist_axle/__init__.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@
3232
from setuptools.command.install import install
3333
from setuptools.command.install_lib import install_lib
3434
from setuptools.command.install_scripts import install_scripts
35-
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel, python_tag
35+
36+
try:
37+
# SetupTools >= 70.1
38+
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel, python
39+
except ImportError:
40+
try:
41+
# Wheel >= 0.44.0
42+
from wheel._bdist_wheel import bdist_wheel as _bdist_wheel, python_tag
43+
except ImportError:
44+
# Wheel < 0.44.0
45+
try:
46+
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel, python_tag
47+
except ImportError:
48+
raise ImportError("Either `setuptools>=70.1` package or `wheel` package is required")
49+
3650
from wheel.vendored.packaging import tags
3751

3852
from wheel_axle.bdist_axle._file_utils import copy_link, copy_tree

0 commit comments

Comments
 (0)