Skip to content

Commit d14db3b

Browse files
committed
Update for Cython v3 and Python 3.12
1 parent 70c3f68 commit d14db3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+949
-683
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
13+
- package-ecosystem: "gitsubmodule"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"

.github/workflows/build_wheels.yml

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

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os:
11+
- ubuntu-latest
12+
- macos-latest
13+
- windows-latest
14+
python:
15+
- '3.8'
16+
- '3.11'
17+
- '3.13'
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
submodules: true
23+
24+
- name: Cache pip
25+
uses: actions/cache@v4
26+
with:
27+
key: cache--${{ matrix.os }}--${{ matrix.python }}--${{ hashFiles('./requirements*.txt', './Makefile') }}
28+
restore-keys: cache--${{ matrix.os }}--${{ matrix.python }}--
29+
path: ~/.cache/pip
30+
31+
- name: Setup python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python }}
35+
36+
- name: Display Python version
37+
run: python -c 'import sys; print(sys.version)'
38+
39+
- name: Update pip
40+
run: python -m pip install -U pip wheel setuptools
41+
42+
- name: Install requirements
43+
run: python -m pip install -Ur requirements-dev.txt
44+
45+
- name: Compile project
46+
run: make install
47+
48+
- name: Run basic sanity test
49+
run: python basic-sanity-test.py
50+
51+
black:
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
submodules: true
58+
59+
- name: Setup python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: '3.11'
63+
64+
- name: Update black
65+
run: python -m pip install -U black
66+
67+
- name: Run black
68+
run: python -m black --check ./*.py ./docs/ ./lib/

.github/workflows/codeql-analysis.yml

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

.github/workflows/linux.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Build Wheels (Linux v3)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
platform:
7+
required: true
8+
default: x86_64 i686 aarch64 ppc64le s390x armv7l
9+
10+
jobs:
11+
define-matrix:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
matrix: ${{ steps.set-matrix.outputs.matrix }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: true
19+
20+
- name: Setup python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.13'
24+
25+
- run: python -m pip install -U pip wheel setuptools
26+
- run: python -m pip install -U 'cibuildwheel==2.*'
27+
28+
- id: set-matrix
29+
run: |
30+
TARGETS="$(python -m cibuildwheel --archs "${{ github.event.inputs.platform }}" --print-build-identifiers)"
31+
echo 'matrix=["'$(echo $TARGETS | sed -e 's/ /","/g')'"]' >> $GITHUB_OUTPUT
32+
env:
33+
CIBW_BUILD_FRONTEND: build
34+
CIBW_SKIP: 'cp27-* pp*'
35+
CIBW_DEPENDENCY_VERSIONS: pinned
36+
CIBW_PLATFORM: linux
37+
38+
build:
39+
runs-on: ubuntu-latest
40+
41+
needs:
42+
- define-matrix
43+
strategy:
44+
matrix:
45+
only: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
submodules: true
51+
52+
- name: Set up QEMU
53+
uses: docker/setup-qemu-action@v3
54+
with:
55+
platforms: all
56+
57+
- name: Cache pip
58+
uses: actions/cache@v4
59+
with:
60+
key: cache--${{ hashFiles('./requirements-dev.txt') }}
61+
path: ~/.cache/pip
62+
63+
- name: Setup python
64+
uses: actions/setup-python@v5
65+
with:
66+
python-version: '3.13'
67+
68+
- run: python -m pip install -U pip wheel setuptools
69+
- run: python -m pip install -Ur requirements-dev.txt
70+
- run: python -m pip install -U 'cibuildwheel==2.*'
71+
72+
- run: python -m cibuildwheel --output-dir wheelhouse --only ${{ matrix.only }}
73+
env:
74+
CIBW_BUILD_FRONTEND: build
75+
CIBW_SKIP: 'cp27-* pp*'
76+
CIBW_DEPENDENCY_VERSIONS: pinned
77+
CIBW_PLATFORM: linux
78+
CIBW_TEST_COMMAND: python {project}/basic-sanity-test.py
79+
CIBW_BEFORE_BUILD: make prepare
80+
81+
- uses: actions/upload-artifact@v4
82+
with:
83+
name: ${{ matrix.only }}
84+
path: ./wheelhouse
85+
retention-days: 1
86+
87+
combine:
88+
runs-on: ubuntu-latest
89+
needs:
90+
- define-matrix
91+
- build
92+
steps:
93+
- uses: actions/download-artifact@v4
94+
with:
95+
path: ./wheelhouse
96+
- run: |
97+
find -name '*.zip' -exec unzip '{}' ';'
98+
find -name '*.zip' -exec rm '{}' +
99+
find -name '*.whl' -exec mv -t. '{}' +
100+
find -type d -delete
101+
working-directory: ./wheelhouse
102+
- uses: actions/upload-artifact@v4
103+
with:
104+
name: wheelhouse
105+
path: ./wheelhouse

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
*.py[cdo]
22

3-
/env*/
4-
/build/
5-
/built_wheel/
6-
/cython_debug/
7-
/dist/
8-
/*.egg-info/
3+
env*/
4+
build/
5+
built_wheel/
6+
cython_debug/
7+
dist/
8+
*.egg-info/
99

1010
*.c
1111
*.cpp

0 commit comments

Comments
 (0)