Skip to content

Commit

Permalink
[Python] Wheel build tool: hatchling. cibuildwheel version updated to…
Browse files Browse the repository at this point in the history
… v2.21 (#1741)
  • Loading branch information
Peguen authored Sep 23, 2024
1 parent 756cb2e commit 0c615a2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fetch-depth: 0

- name: Build wheels
uses: pypa/cibuildwheel@v2.17
uses: pypa/cibuildwheel@v2.21
env:
CIBW_ARCHS: auto64

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.17
uses: pypa/cibuildwheel@v2.21
env:
CIBW_ARCHS_LINUX: aarch64

Expand Down
43 changes: 24 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,26 @@ dynamic = ["version"]
"Source" = "https://github.com/eclipse-ecal/ecal"

[build-system] # How pip and other frontends should build this project
# Version 8 of setuptools_scm drops Python 3.7
requires = ["scikit-build-core>=0.8", "setuptools_scm~=7.1"]
build-backend = "scikit_build_core.build"
requires = ["hatchling", "hatch-vcs", "scikit-build-core~=0.10.6"]
build-backend = "hatchling.build"

[tool.setuptools_scm]
write_to = "lang/python/core/ecal/_version.py"
[tool.hatch.build.targets.wheel.hooks.scikit-build]
experimental = true

[tool.scikit-build]
# Setuptools-scm to provide the package version from git
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
# Will be installed from PyPI if system version is too old/missing
cmake.version = ">=3.18"
cmake.targets = ["ecal_python"] # Targets to build
build-dir = "./_python_build" # Build directory for unisolated builds
install.components = ["python"] # CMake component to install
[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "lang/python/core/ecal/_version.py"

[tool.hatch.build.targets]
# Directory structure to copy as Python package, last path component is
# the package name
# wheel.packages = ["lang/python/package/ecal"]
wheel.packages = ["lang/python/core/ecal", "lang/python/ecalhdf5/ecal"]

# Files to include in the source archive to build from
sdist.exclude = ["*"]
sdist.include = [
sdist.only-include = [
"/CMakeLists.txt",
"/pyproject.toml",
"/LICENSE.txt",
Expand All @@ -50,19 +48,19 @@ sdist.include = [
"/cmake/",
"/contrib/",
"/cpack/",
"/ecal/core/",
"/ecal/service/",
"/ecal/CMakeLists.txt",
"/ecal/",
"/lib/",
"/licenses/",
"lang/python/",

"thirdparty/cmakefunctions/",
"thirdparty/ecaludp/",
"thirdparty/protobuf/",
"thirdparty/recycle/",
"thirdparty/simpleini/",
"thirdparty/tclap/",
"thirdparty/tcp_pubsub/",
"thirdparty/yaml-cpp/",

"thirdparty/asio/",
"!thirdparty/asio/asio/asio/src/",
Expand All @@ -79,6 +77,13 @@ sdist.include = [

]

[tool.scikit-build]
# Will be installed from PyPI if system version is too old/missing
cmake.version = ">=3.18"
build.targets = ["ecal_python"] # Targets to build
build-dir = "./_python_build" # Build directory for unisolated builds
install.components = ["python"] # CMake component to install

[tool.scikit-build.cmake.define]
CMAKE_PROJECT_TOP_LEVEL_INCLUDES = "cmake/submodule_dependencies.cmake"
HAS_HDF5 = "ON"
Expand Down Expand Up @@ -111,4 +116,4 @@ HDF5_EXTERNALLY_CONFIGURED = "ON"
# architecture changes and causes link errors with Python
archs = ["auto64"]
# eCAL has build errors on musl libc
skip = [ "*-musllinux*" ]
skip = [ "*-musllinux*" ]

0 comments on commit 0c615a2

Please sign in to comment.