-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from ssciwr/use_scikit_build_core
Use scikit-build-core instead of scikit-build
- Loading branch information
Showing
9 changed files
with
92 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,25 +34,25 @@ jobs: | |
skip: ["*manylinux*", "*musllinux*"] | ||
include: | ||
# initially generate all 10 matrix combinations with qemu on ubuntu: | ||
- os: ubuntu-20.04 | ||
- os: ubuntu-latest | ||
use_qemu: true | ||
# modify the x86_64 and i686 jobs generated above to disable qemu | ||
- os: ubuntu-20.04 | ||
- os: ubuntu-latest | ||
arch: "x86_64" | ||
use_qemu: false | ||
- os: ubuntu-20.04 | ||
- os: ubuntu-latest | ||
arch: "i686" | ||
use_qemu: false | ||
# additional runs (they define skip="" to ensure they cannot be combined with any matrix combinations) | ||
- os: windows-2019 | ||
- os: windows-latest | ||
arch: "AMD64" | ||
use_qemu: false | ||
skip: "" | ||
- os: windows-2019 | ||
- os: windows-latest | ||
arch: "x86" | ||
use_qemu: false | ||
skip: "" | ||
- os: macos-11 | ||
- os: macos-latest | ||
arch: "x86_64" | ||
use_qemu: false | ||
skip: "" | ||
|
@@ -70,11 +70,17 @@ jobs: | |
if: runner.os == 'Windows' && ((!matrix.use_qemu) || fromJSON(env.USE_QEMU)) | ||
run: git config --system core.longpaths true | ||
|
||
- name: Set up msvc on Windows | ||
if: runner.os == 'Windows' | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
|
||
- name: Override LLVM version (${{ github.event.inputs.llvm_version }}) | ||
if: github.event.inputs.llvm_version | ||
run: | | ||
echo "set(CLANG_FORMAT_VERSION ${{ github.event.inputs.llvm_version }})" > clang-format_version.cmake | ||
echo "set(CLANG_FORMAT_WHEEL_VERSION ${{ github.event.inputs.wheel_version }})" >> clang-format_version.cmake | ||
echo "${{ github.event.inputs.llvm_version }}.${{ github.event.inputs.wheel_version }}" > clang-format_version.txt | ||
cat clang-format_version.txt | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
@@ -95,16 +101,16 @@ jobs: | |
|
||
build-sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Override LLVM version (${{ github.event.inputs.llvm_version }}) | ||
if: github.event.inputs.llvm_version | ||
run: | | ||
echo "set(CLANG_FORMAT_VERSION ${{ github.event.inputs.llvm_version }})" > clang-format_version.cmake | ||
echo "set(CLANG_FORMAT_WHEEL_VERSION ${{ github.event.inputs.wheel_version }})" >> clang-format_version.cmake | ||
echo "${{ github.event.inputs.llvm_version }}.${{ github.event.inputs.wheel_version }}" > clang-format_version.txt | ||
cat clang-format_version.txt | ||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
@@ -117,7 +123,7 @@ jobs: | |
test-sdist: | ||
name: Test build from source distribution | ||
needs: [build-sdist] | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -152,7 +158,7 @@ jobs: | |
upload_pypi: | ||
name: Upload to PyPI | ||
needs: [build-wheels, build-sdist, test-sdist] | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
if: github.repository_owner == 'ssciwr' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18.1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,54 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.16", "ninja; platform_system!='Windows'"] | ||
requires = ["scikit-build-core"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "clang-format" | ||
dynamic = ["version"] | ||
authors = [{name = "Dominic Kempf", email = "[email protected]"}] | ||
license = { text = "Apache 2.0" } | ||
description = "Clang-Format is an LLVM-based code formatting tool" | ||
readme = "README.md" | ||
classifiers = [ | ||
"Programming Language :: C", | ||
"Programming Language :: C++", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Quality Assurance", | ||
] | ||
|
||
[tool.scikit-build.metadata.version] | ||
provider = "scikit_build_core.metadata.regex" | ||
regex = '^(?P<value>\d+\.\d+\.\d+(\.[1-9]\d*)?)' | ||
input = "clang-format_version.txt" | ||
|
||
[project.urls] | ||
Clang = "http://clang.llvm.org/" | ||
Documentation = "https://clang.llvm.org/docs/ClangFormat.html" | ||
Download = "https://github.com/llvm/llvm-project/releases" | ||
Source = "https://github.com/ssciwr/clang-format-wheel" | ||
|
||
[project.scripts] | ||
"clang-format" = "clang_format:clang_format" | ||
"git-clang-format" = "clang_format.git_clang_format:main" | ||
"clang-format-diff.py" = "clang_format.clang_format_diff:main" | ||
|
||
[tool.scikit-build] | ||
wheel.packages = ["clang_format"] | ||
wheel.py-api = "py2.py3" | ||
cmake.version = ">=3.16.0" | ||
ninja.version = ">=1.10.0" | ||
cmake.verbose = true | ||
logging.level = "DEBUG" | ||
|
||
[tool.cibuildwheel] | ||
# Super-verbose output for debugging purpose | ||
build-verbosity = 3 | ||
# Set CMAKE_GENERATOR env var which is respected by scikit-build-core to use Ninja on all platforms | ||
environment = "CMAKE_GENERATOR=Ninja" | ||
|
||
# We restrict ourselves to CPython 3.9 and then repair the wheels to be | ||
# independent of the Python version - I have not found a different solution | ||
# within cibuildwheel to achieve this. | ||
# restrict to a single Python version as wheel does not depend on Python | ||
build = "cp39-*" | ||
|
||
# Testing commands for our wheels | ||
|