Skip to content

Commit dc56e41

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

Some content is hidden

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

44 files changed

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