diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d59f9fd..dbd263d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,7 +72,7 @@ jobs: artifact_suffix: "windows_x86" use_qemu: false - os: macos-14 - arch: "arm64 universal2 x86_64" + arch: "universal2" build: "" artifact_suffix: "macos" use_qemu: false @@ -102,7 +102,6 @@ jobs: uses: pypa/cibuildwheel@v2.16.5 env: CIBW_ARCHS: "${{ matrix.arch }}" - CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" CIBW_BUILD: "cp39-${{ matrix.build }}*" - uses: actions/upload-artifact@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 78783cd..b81769b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(SwigPythonDistributions NONE) diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index caf0a8f..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include CMakeLists.txt -include README.md -include LICENSE-SWIG -include LICENSE-GPL -include LICENSE-UNIVERSITIES - -recursive-exclude _skbuild * diff --git a/pyproject.toml b/pyproject.toml index a6fcd48..eca3bca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,6 @@ [build-system] -requires = ["setuptools>=64", "wheel", "scikit-build", "setuptools_scm>=8"] -build-backend = "setuptools.build_meta" - -[tool.cibuildwheel] -build = "cp39-*" -before-all = [ - "pipx install -f cmake==3.21.4", - "cmake --version", - "pipx install -f ninja==1.10.2.2", - "ninja --version", -] -test-command = [ - "swig -version", - "swig -pcreversion", - "swig -help", -] - -[tool.cibuildwheel.linux] -manylinux-x86_64-image = "manylinux1" -manylinux-i686-image = "manylinux1" +requires = ["scikit-build-core"] +build-backend = "scikit_build_core.build" [project] name = "swig" @@ -39,6 +21,28 @@ classifiers = [ ] dynamic = ["version"] + +[tool.scikit-build] +wheel.py-api = "py2.py3" +wheel.expand-macos-universal-tags = true +metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" +sdist.include = ["src/swig/_version.py"] +wheel.install-dir = "swig/data" + +[tool.cibuildwheel] +build = "cp39-*" +test-command = [ + "swig -version", + "swig -pcreversion", + "swig -help", +] +environment.PIP_ONLY_BINARY = ":all:" + +[tool.cibuildwheel.linux] +manylinux-x86_64-image = "manylinux1" +manylinux-i686-image = "manylinux1" + + [project.scripts] swig = "swig:swig" "swig4.0" = "swig:swig" @@ -49,14 +53,5 @@ Download = "https://swig.org/download.html" "Source Code" = "https://github.com/nightlark/swig-pypi" "Bug Tracker" = "https://github.com/nightlark/swig-pypi/issues" -# Should be possible to specify these fields too, except then "shared" data files end up in the wrong subfolder -# Eventually should try migrating to scikit-build-core and ditching setuptools entirely -#[tool.setuptools] -#packages = ["swig"] -#package-dir = {"" = "src"} -# -#[tool.setuptools.package-data] -#swig = ["data/*"] - [tool.setuptools_scm] write_to = "src/swig/_version.py" diff --git a/setup.py b/setup.py deleted file mode 100644 index d5d9447..0000000 --- a/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -import sys -from distutils.text_file import TextFile -from wheel.bdist_wheel import bdist_wheel as _bdist_wheel -from skbuild import setup - - -class genericpy_bdist_wheel(_bdist_wheel): - def finalize_options(self): - _bdist_wheel.finalize_options(self) - self.root_is_pure = False - - def get_tag(self): - python, abi, plat = _bdist_wheel.get_tag(self) - python, abi = "py2.py3", "none" - return python, abi, plat - - -cmdclass = {"bdist_wheel": genericpy_bdist_wheel} - -setup( - cmdclass=cmdclass, - cmake_install_dir="src/swig/data", - packages=["swig"], - package_dir={"": "src"}, -)