Skip to content

Commit

Permalink
convert to scikit-build-core
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann committed Sep 19, 2024
1 parent 431c03d commit a7e0e76
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 188 deletions.
88 changes: 40 additions & 48 deletions .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-python@v4

- uses: actions/setup-python@v5

- name: Install dependencies
run: |
Expand Down Expand Up @@ -44,8 +45,9 @@ jobs:
run: |
tools/seg_wrapper.sh pytest tests
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz

build_wheels_windows:
Expand All @@ -56,21 +58,17 @@ jobs:
fail-fast: false
matrix:
arch: [auto32, auto64, ARM64]
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
python_tag: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "pp39-*", "pp310-*"]
exclude:
# PyPy only supports x86_64 on Windows
- arch: auto32
python_tag: "pp38-*"
- arch: auto32
python_tag: "pp39-*"

# ARM64 only supported only supported on cpython >= 3.9
- arch: ARM64
python_tag: "pp38-*"
- arch: auto32
python_tag: "pp310-*"
- arch: ARM64
python_tag: "pp39-*"
- arch: ARM64
python_tag: "cp38-*"
python_tag: "pp310-*"

env:
CIBW_BUILD: ${{matrix.python_tag}}
Expand All @@ -80,25 +78,26 @@ jobs:
CIBW_BUILD_VERBOSITY: 3

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
name: artifact-sdist
path: dist

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5

- name: Copy wheel
run: cp dist/*.tar.gz rapidfuzz.tar.gz

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
with:
package-dir: rapidfuzz.tar.gz
output-dir: wheelhouse

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.job }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_wheels_macos:
Expand All @@ -109,17 +108,7 @@ jobs:
fail-fast: false
matrix:
arch: [x86_64, arm64, universal2]
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
exclude:
# PyPy not supported on MacOS Arm
- arch: arm64
python_tag: "pp38-*"
- arch: arm64
python_tag: "pp39-*"
- arch: universal2
python_tag: "pp38-*"
- arch: universal2
python_tag: "pp39-*"
python_tag: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "pp39-*", "pp310-*"]
env:
CIBW_BUILD: ${{matrix.python_tag}}
CIBW_ARCHS: ${{matrix.arch}}
Expand All @@ -129,25 +118,26 @@ jobs:
CIBW_BUILD_VERBOSITY: 3

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
name: artifact-sdist
path: dist

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5

- name: Copy wheel
run: cp dist/*.tar.gz rapidfuzz.tar.gz

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
with:
package-dir: rapidfuzz.tar.gz
output-dir: wheelhouse

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.job }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_wheels_linux:
Expand All @@ -158,17 +148,17 @@ jobs:
fail-fast: false
matrix:
arch: [auto, aarch64, ppc64le, s390x]
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
python_tag: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "pp39-*", "pp310-*"]
exclude:
# PyPy builds not supported on ppc64le / s390x
- arch: ppc64le
python_tag: "pp38-*"
- arch: ppc64le
python_tag: "pp39-*"
- arch: s390x
python_tag: "pp38-*"
- arch: ppc64le
python_tag: "pp310-*"
- arch: s390x
python_tag: "pp39-*"
- arch: s390x
python_tag: "pp310-*"
env:
CIBW_ARCHS_LINUX: ${{matrix.arch}}
CIBW_BUILD: ${{matrix.python_tag}}
Expand All @@ -178,28 +168,29 @@ jobs:
CIBW_BUILD_VERBOSITY: 3

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
name: artifact-sdist
path: dist

- uses: actions/setup-python@v4

- uses: docker/setup-qemu-action@v2
name: Set up QEMU
- uses: actions/setup-python@v5

- name: Copy wheel
run: cp dist/*.tar.gz rapidfuzz.tar.gz

- uses: docker/setup-qemu-action@v3
name: Set up QEMU

- name: Build wheel
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
with:
package-dir: rapidfuzz.tar.gz
output-dir: wheelhouse

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.job }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

deploy-wheels:
Expand All @@ -211,9 +202,10 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
pattern: artifact-*
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@v1.8.11
- uses: pypa/gh-action-pypi-publish@v1.8.11
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ cython_debug/
# vscode
.vscode/
_skbuild/

# Cython generated files
*.cxx
32 changes: 14 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
#
# See https://github.com/pre-commit/pre-commit

exclude: |
(?x)(
.*\.patch
)
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v4.6.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -32,26 +37,26 @@ repos:

# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black
rev: "24.1.1" # Keep in sync with blacken-docs
rev: "24.8.0" # Keep in sync with blacken-docs
hooks:
- id: black

# Also code format the docs
- repo: https://github.com/asottile/blacken-docs
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: blacken-docs
additional_dependencies:
- black==22.8.0 # keep in sync with black hook

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.4"
rev: "v1.5.5"
hooks:
- id: remove-tabs

- repo: https://github.com/sirosen/texthooks
rev: "0.6.4"
rev: "0.6.7"
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand All @@ -68,7 +73,7 @@ repos:

# PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint
rev: "v3.0.3"
rev: "v3.2.7"
hooks:
- id: pylint
files: ^pybind11
Expand All @@ -91,24 +96,15 @@ repos:
# exclude: ^(tests|docs)/
# additional_dependencies: [nox, rich]

# Checks the manifest for missing files (native support)
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
# This is a slow hook, so only run this if --hook-stage manual is passed
stages: [manual]
additional_dependencies: [cmake, ninja]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.1
rev: v0.6.5
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

# Check for spelling
- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.3.0"
hooks:
- id: codespell
exclude: ".*/test_.*.py"
Expand All @@ -131,7 +127,7 @@ repos:

# Clang format the codebase automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v17.0.6"
rev: "v18.1.8"
hooks:
- id: clang-format
types_or: [c++, c]
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.12...3.24)
cmake_minimum_required(VERSION 3.15...3.26)

cmake_policy(SET CMP0054 NEW)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

### v0.26.0
#### Changed
- add support for Python 3.13
- switch build system to `scikit-build-core`

### v0.25.1
#### Fixed
- fix potentially incorrect results of `jaro_winkler` when using high prefix weights
Expand Down
16 changes: 0 additions & 16 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ computation of:
* string sequence and set similarity

## Requirements
* Python 3.8 or later
* Python 3.9 or later

## Installation
```bash
Expand Down
Loading

0 comments on commit a7e0e76

Please sign in to comment.