Skip to content

Commit

Permalink
feat: move to scikit-build-core (#126)
Browse files Browse the repository at this point in the history
* feat: move to scikit-build-core

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* feat: produce one macOS wheel with all tags

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: Only download binary deps, don't try to build them

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update build.yml

* Apply suggestions from code review

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii authored May 25, 2024
1 parent 9a7711e commit bbcf58e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 65 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -105,7 +105,6 @@ jobs:
uses: pypa/cibuildwheel@v2.18.1
env:
CIBW_ARCHS: "${{ matrix.arch }}"
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
CIBW_BUILD: "cp39-${{ matrix.build }}*"

- uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.15)

project(SwigPythonDistributions NONE)

Expand Down
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

53 changes: 24 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -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"
26 changes: 0 additions & 26 deletions setup.py

This file was deleted.

0 comments on commit bbcf58e

Please sign in to comment.