Skip to content

Commit

Permalink
Fix bdist_wheel migrating into setuptools
Browse files Browse the repository at this point in the history
If `setuptools>=70.1` are available - use that
Otherwise support `wheel` versions before and after migration

fixes #22
  • Loading branch information
arcivanov committed Aug 9, 2024
1 parent 4ef8b30 commit c598625
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 27 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ jobs:
- '3.10'
- '3.9'
pip-version:
- '24.2'
- '24.1'
- '24.0'
- '23.3'
- '22.3'
setuptools-version:
- '70.1'
- '70.0'
- '72.2'
- '71.1'
- '70.3'
- '69.5'
- '68.2'
- '67.0'
- '66.0'
- '65.0'
- '67.8'
- '66.1'
- '65.7'
exclude:
- python-version: '3.12'
setuptools-version: '65.0'
- python-version: '3.12'
pip-version: '22.2'
setuptools-version: '65.7'
- python-version: '3.12'
pip-version: '22.3'
env:
DEPLOY_PYTHONS: "3.12"
DEPLOY_OSES: "Linux"
DEPLOY_PIPS: "24.0"
DEPLOY_SETUPTOOLS: "70.0"
DEPLOY_PIPS: "24.2"
DEPLOY_SETUPTOOLS: "72.2"
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -86,36 +86,38 @@ jobs:
- '3.8'
- '3.7'
pip-version:
- '24.2'
- '24.1'
- '24.0'
- '23.3'
- '22.3'
setuptools-version:
- '70.1'
- '70.0'
- '72.2'
- '71.1'
- '70.3'
- '69.5'
- '68.2'
- '68.1'
- '68.0'
- '67.0'
- '66.0'
- '65.0'
- '67.8'
- '66.1'
- '65.7'
- '64.0'
- '63.0'
- '62.0'
- '63.4'
- '62.6'
exclude:
- python-version: '3.7'
setuptools-version: '68.2'
- python-version: '3.7'
setuptools-version: '68.1'
- python-version: '3.7'
setuptools-version: '69.5'
- python-version: '3.7'
setuptools-version: '70.0'
setuptools-version: '70.3'
- python-version: '3.7'
setuptools-version: '71.1'
- python-version: '3.7'
setuptools-version: '70.1'
setuptools-version: '72.2'
- python-version: '3.7'
pip-version: '24.1'
- python-version: '3.7'
pip-version: '24.2'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down Expand Up @@ -144,9 +146,9 @@ jobs:
python-version:
- '3.13-dev'
pip-version:
- '24.1'
- '24.2'
setuptools-version:
- '70.1'
- '72.2'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
11 changes: 10 additions & 1 deletion src/integrationtest/python/build_axle_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@
from subprocess import check_call
from tempfile import TemporaryDirectory

from wheel.bdist_wheel import get_abi_tag, get_platform, tags
try:
# SetupTools >= 70.1
from setuptools.command.bdist_wheel import get_abi_tag, get_platform, tags
except ImportError:
try:
# Wheel >= 0.44.0
from wheel._bdist_wheel import get_abi_tag, get_platform, tags
except ImportError:
# Wheel < 0.44.0
from wheel.bdist_wheel import get_abi_tag, get_platform, tags


class BuildAxleTest(unittest.TestCase):
Expand Down
16 changes: 15 additions & 1 deletion src/main/python/wheel_axle/bdist_axle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@
from setuptools.command.install import install
from setuptools.command.install_lib import install_lib
from setuptools.command.install_scripts import install_scripts
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel, python_tag

try:
# SetupTools >= 70.1
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel, python
except ImportError:
try:
# Wheel >= 0.44.0
from wheel._bdist_wheel import bdist_wheel as _bdist_wheel, python_tag
except ImportError:
# Wheel < 0.44.0
try:
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel, python_tag
except ImportError:
raise ImportError("Either `setuptools>=70.1` package or `wheel` package is required")

from wheel.vendored.packaging import tags

from wheel_axle.bdist_axle._file_utils import copy_link, copy_tree
Expand Down

0 comments on commit c598625

Please sign in to comment.