Skip to content

Commit

Permalink
Merge pull request #23 from karellen/issue_22
Browse files Browse the repository at this point in the history
Fix `bdist_wheel` migrating into `setuptools`
  • Loading branch information
arcivanov committed Aug 9, 2024
2 parents 4ef8b30 + 2b01bc0 commit 9044a12
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 38 deletions.
60 changes: 24 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,31 @@ jobs:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
pip-version:
- '24.2'
- '24.1'
- '24.0'
- '23.3'
- '22.3'
setuptools-version:
- '70.1'
- '70.0'
- '72.1'
- '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.1"
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -74,6 +73,7 @@ jobs:
python-version: ${{ matrix.python-version }}
pyb-extra-args: ${{ env.PYB_EXTRA_ARGS }}
build-secondary:
needs: 'build-primary'
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
Expand All @@ -83,39 +83,26 @@ jobs:
- ubuntu-latest
- macos-13
python-version:
- '3.9'
- '3.8'
- '3.7'
pip-version:
- '24.2'
- '24.1'
- '24.0'
- '23.3'
- '22.3'
setuptools-version:
- '70.1'
- '70.0'
- '72.1'
- '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'
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'
- python-version: '3.7'
setuptools-version: '70.1'
- python-version: '3.7'
pip-version: '24.1'
- '63.4'
- '62.6'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -133,6 +120,7 @@ jobs:
python-version: ${{ matrix.python-version }}
pyb-extra-args: ${{ env.PYB_EXTRA_ARGS }}
build-experimental:
needs: 'build-primary'
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
Expand All @@ -144,9 +132,9 @@ jobs:
python-version:
- '3.13-dev'
pip-version:
- '24.1'
- '24.2'
setuptools-version:
- '70.1'
- '72.1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 9044a12

Please sign in to comment.