diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 5750dd2..8e6b0e8 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -48,7 +48,7 @@ jobs: CMAKE_GENERATOR_PLATFORM=x64 CMAKE_BUILD_PARALLEL_LEVEL=${{ steps.get_num_cores.outputs.count }} CIBW_ARCHS: AMD64 - CIBW_BEFORE_BUILD: python -m pip install setuptools wheel delvewheel # skip CasADi and CMake + CIBW_BEFORE_BUILD: python -m pip install setuptools delvewheel # skip CasADi and CMake CIBW_REPAIR_WHEEL_COMMAND: delvewheel repair --add-path C:/Windows/System32 -w {dest_dir} {wheel} CIBW_TEST_EXTRAS: "dev" CIBW_TEST_COMMAND: | @@ -203,7 +203,7 @@ jobs: # 10.13 for Intel (macos-13), 11.0 for Apple Silicon (macos-14 and macos-latest) MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-14' && '11.0' || '10.13' }} CIBW_ARCHS_MACOS: auto - CIBW_BEFORE_BUILD: python -m pip install cmake casadi setuptools wheel delocate + CIBW_BEFORE_BUILD: python -m pip install cmake casadi setuptools delocate CIBW_REPAIR_WHEEL_COMMAND: | if [[ $(uname -m) == "x86_64" ]]; then delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel} diff --git a/pyproject.toml b/pyproject.toml index da35f93..f08975d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = [ - "setuptools>=64", - "wheel", + "setuptools>=70.1.1", # On Windows, use the CasADi vcpkg registry and CMake bundled from MSVC "casadi>=3.6.7; platform_system!='Windows'", # Note: the version of CasADi as a build-time dependency should be matched diff --git a/setup.py b/setup.py index 65e3e6c..0bc1940 100644 --- a/setup.py +++ b/setup.py @@ -4,11 +4,11 @@ from multiprocessing import cpu_count from pathlib import Path from platform import system -import wheel.bdist_wheel as orig from setuptools import setup, Extension from setuptools.command.install import install from setuptools.command.build_ext import build_ext +from setuptools.command.bdist_wheel import bdist_wheel default_lib_dir = ( @@ -207,29 +207,29 @@ def run(self): # ---------- Custom class for building wheels ------------------------------------------ -class bdist_wheel(orig.bdist_wheel): +class PyBaMMWheel(bdist_wheel): """A custom installation command to add 2 build options""" user_options = [ - *orig.bdist_wheel.user_options, + *bdist_wheel.user_options, ("suitesparse-root=", None, "suitesparse source location"), ("sundials-root=", None, "sundials source location"), ] def initialize_options(self): - orig.bdist_wheel.initialize_options(self) + bdist_wheel.initialize_options(self) self.suitesparse_root = None self.sundials_root = None def finalize_options(self): - orig.bdist_wheel.finalize_options(self) + bdist_wheel.finalize_options(self) if not self.suitesparse_root: self.suitesparse_root = default_lib_dir if not self.sundials_root: self.sundials_root = default_lib_dir def run(self): - orig.bdist_wheel.run(self) + bdist_wheel.run(self) ext_modules = [ @@ -288,7 +288,7 @@ def run(self): ext_modules=ext_modules, cmdclass={ "build_ext": CMakeBuild, - "bdist_wheel": bdist_wheel, + "bdist_wheel": PyBaMMWheel, "install": CustomInstall, }, )