Skip to content

Commit b45509e

Browse files
authored
Merge pull request #7 from segevfiner/copilot/tech-refresh-upgrades
Tech refresh: scikit-build-core, GitHub Actions upgrades, Python 3.9–3.14
2 parents 55713a3 + a8991b8 commit b45509e

8 files changed

Lines changed: 152 additions & 99 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build & Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
18+
19+
steps:
20+
- uses: actions/checkout@v7
21+
with:
22+
submodules: true
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v7
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
- name: Install
31+
run: |
32+
pip install -e .[dev]

.github/workflows/docs.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,54 @@ on:
55
branches:
66
- main
77

8-
jobs:
9-
docs:
10-
runs-on: windows-2019
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
1118

12-
env:
13-
# XXX https://github.com/scikit-build/scikit-build/issues/740
14-
SETUPTOOLS_ENABLE_FEATURES: legacy-editable
19+
jobs:
20+
build:
21+
runs-on: windows-latest
1522

1623
steps:
17-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v7
1825
with:
1926
submodules: true
2027

21-
- uses: actions/setup-python@v5
28+
- uses: actions/setup-python@v7
2229
with:
23-
python-version: '3.12'
30+
python-version: '3.14'
2431
- name: Install dependencies
2532
run: |
26-
python -m pip install --upgrade pip setuptools wheel
33+
python -m pip install --upgrade pip
2734
- name: Install
2835
run: |
2936
pip install -e .[dev]
37+
- name: Setup Pages
38+
id: pages
39+
uses: actions/configure-pages@v6
3040
- name: Build documentation
3141
run: |
3242
make html
3343
working-directory: ./docs
34-
- name: Deploy
35-
uses: peaceiris/actions-gh-pages@v4
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v5
3646
with:
37-
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: ./docs/_build/html
47+
path: ./docs/_build/html
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v5

.github/workflows/wheels.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,72 @@ on:
55
branches:
66
- main
77
tags:
8-
- v[0-9].*
8+
- 'v[0-9].*'
99
workflow_dispatch:
1010

1111
jobs:
1212
build_wheels:
1313
name: Build wheels on ${{ matrix.os }}
1414
runs-on: ${{ matrix.os }}
1515
strategy:
16+
fail-fast: false
1617
matrix:
17-
os: [windows-2019]
18+
os: [windows-2022]
1819

1920
steps:
20-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v7
2122
with:
2223
submodules: true
2324

24-
- uses: actions/setup-python@v5
25+
- uses: actions/setup-python@v7
2526
with:
26-
python-version: '3.12'
27+
python-version: '3.14'
2728

2829
- name: Build sdist
29-
if: matrix.os == 'windows-2019'
30+
if: matrix.os == 'windows-2022'
3031
run: |
3132
pip install build
3233
python -m build --sdist
3334
3435
- name: Build wheels
35-
uses: pypa/cibuildwheel@v2.21.3
36+
uses: pypa/cibuildwheel@v4.2.0
3637
env:
3738
CIBW_SKIP: 'pp*'
38-
CIBW_BEFORE_BUILD: |
39-
if exist _skbuild rmdir /s /q _skbuild
40-
# XXX https://github.com/scikit-build/scikit-build/issues/740
41-
CIBW_ENVIRONMENT: >
42-
SETUPTOOLS_ENABLE_FEATURES=legacy-editable
4339
with:
4440
output-dir: dist
4541

46-
- uses: actions/upload-artifact@v4
42+
- uses: actions/upload-artifact@v7
4743
with:
4844
name: wheels-${{ matrix.os }}
4945
path: dist/*
5046

51-
upload_release:
52-
name: Upload release
47+
publish:
48+
name: Publish
5349
needs: [build_wheels]
5450
runs-on: ubuntu-latest
5551
if: startsWith(github.ref, 'refs/tags/')
5652

53+
permissions:
54+
contents: write
55+
id-token: write
56+
57+
environment:
58+
name: pypi
59+
url: https://pypi.org/project/cyminhook/
60+
5761
steps:
58-
- uses: actions/download-artifact@v4
62+
- uses: actions/download-artifact@v8
5963
with:
6064
pattern: wheels-*
6165
merge-multiple: true
6266
path: dist
6367

68+
- name: Publish release distributions to PyPI
69+
uses: pypa/gh-action-pypi-publish@release/v1
70+
with:
71+
packages-dir: dist
72+
6473
- name: Release
65-
uses: softprops/action-gh-release@v1
74+
uses: softprops/action-gh-release@v3
6675
with:
67-
draft: true
6876
files: dist/*

CMakeLists.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
cmake_minimum_required(VERSION 3.22)
1+
cmake_minimum_required(VERSION 3.22...4.4)
22

3-
project(cyminhook)
4-
find_package(PythonExtensions REQUIRED)
5-
find_package(Cython REQUIRED)
3+
project(${SKBUILD_PROJECT_NAME} LANGUAGES C)
4+
5+
find_package(
6+
Python
7+
COMPONENTS Interpreter Development.Module
8+
REQUIRED)
9+
find_package(Cython MODULE REQUIRED VERSION 3.0)
10+
include(UseCython)
611

712
add_subdirectory(minhook)
8-
add_subdirectory(cyminhook)
13+
14+
cython_transpile(cyminhook/_cyminhook.pyx LANGUAGE C
15+
OUTPUT_VARIABLE _cyminhook_c)
16+
17+
python_add_library(_cyminhook MODULE ${_cyminhook_c} WITH_SOABI)
18+
target_link_libraries(_cyminhook PRIVATE minhook)
19+
install(TARGETS _cyminhook LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME})

cyminhook/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
[build-system]
2-
requires = ["setuptools>=59", "scikit-build>=0.13.1", "cmake", "ninja; sys_platform != 'win32'", "cython"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["scikit-build-core", "cython>=3.0", "cython-cmake"]
3+
build-backend = "scikit_build_core.build"
4+
5+
[project]
6+
name = "cyminhook"
7+
dynamic = ["version"]
8+
authors = [{ name = "Segev Finer", email = "segev208@gmail.com" }]
9+
description = "Hook functions on Windows using MinHook"
10+
keywords = ["MinHook"]
11+
license = "MIT"
12+
license-files = ["LICENSE"]
13+
readme = "README.rst"
14+
requires-python = ">=3.9"
15+
classifiers = [
16+
"Development Status :: 3 - Alpha",
17+
"Environment :: Win32 (MS Windows)",
18+
"Intended Audience :: Developers",
19+
"Topic :: Security",
20+
"Operating System :: Microsoft :: Windows",
21+
"Programming Language :: Cython",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
29+
]
30+
31+
[project.urls]
32+
homepage = "https://github.com/segevfiner/cyminhook"
33+
documentation = "https://segevfiner.github.io/cyminhook/"
34+
issues = "https://github.com/segevfiner/cyminhook/issues"
35+
36+
[project.optional-dependencies]
37+
dev = [
38+
"sphinx==9.*; python_version >= '3.12'",
39+
]
40+
41+
[[tool.dynamic-metadata]]
42+
provider = "scikit_build_core.metadata.regex"
43+
field = "version"
44+
input = "cyminhook/__init__.py"

setup.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)