From 7a051da1588210cb380df6d9aaf4aea17d15bbd0 Mon Sep 17 00:00:00 2001 From: Ollie Copping Date: Thu, 22 Aug 2024 15:30:43 +0100 Subject: [PATCH] Add bdist_wheel import try from setuptools As of setuptools v70.1, bdist_wheel is a part of setuptools and is being deprecated from wheel. --- src/setuptools_dso/dsocmd.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/setuptools_dso/dsocmd.py b/src/setuptools_dso/dsocmd.py index c911892..f59d310 100644 --- a/src/setuptools_dso/dsocmd.py +++ b/src/setuptools_dso/dsocmd.py @@ -11,10 +11,19 @@ import multiprocessing as MP import logging as log -try: - from wheel.bdist_wheel import bdist_wheel as _bdist_wheel -except ImportError: - _bdist_wheel = None +def _import_bdist_wheel(): + global _bdist_wheel + try: + from setuptools.command import bdist_wheel as _bdist_wheel + return + except ImportError: + pass + try: + from wheel.bdist_wheel import bdist_wheel as _bdist_wheel + except ImportError: + _bdist_wheel = None + +_import_bdist_wheel() from setuptools import Command, Distribution, Extension as _Extension from setuptools.command.build_ext import build_ext as _build_ext