Skip to content

Commit f7aedf5

Browse files
committed
fix ci scripts
1 parent e84e88f commit f7aedf5

File tree

5 files changed

+109
-79
lines changed

5 files changed

+109
-79
lines changed

.github/workflows/branchbuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: "ubuntu-latest"
1212
strategy:
1313
matrix:
14-
python-version: ["3.6", "3.9", "3.10"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1515
os: [ubuntu-latest, windows-latest, macos-latest]
1616

1717
steps:

.github/workflows/releasebuild.yml

Lines changed: 105 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -9,176 +9,207 @@ on:
99
- published
1010

1111
jobs:
12+
build_sdist:
13+
name: Build source distribution
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: 'true'
19+
20+
- uses: actions/setup-python@v4
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install Cython==3.0.7
28+
29+
# The cythonized files allow installation from the sdist without cython
30+
- name: Generate cython
31+
run: |
32+
chmod +x ./src/cython/generate.sh
33+
./src/cython/generate.sh
34+
35+
- name: Build sdist
36+
run: |
37+
pip3 install build; python3 -m build --sdist
38+
# test whether tarball contains all files required for compiling
39+
pip3 install dist/cydifflib-*.tar.gz
40+
pip3 uninstall cydifflib --yes
41+
42+
- uses: actions/upload-artifact@v3
43+
with:
44+
path: dist/*.tar.gz
45+
1246
build_wheels_windows:
1347
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
48+
needs: [build_sdist]
1449
runs-on: windows-latest
1550
strategy:
1651
fail-fast: false
1752
matrix:
18-
arch: [auto32, auto64]
19-
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "pp37-*", "pp38-*"]
53+
arch: [auto32, auto64, ARM64]
54+
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
2055
exclude:
2156
# PyPy only supports x86_64 on Windows
2257
- arch: auto32
23-
python_tag: "pp37-*"
58+
python_tag: "pp39-*"
2459
- arch: auto32
25-
python_tag: "pp38-*"
60+
python_tag: "pp39-*"
2661

27-
# PyPy Windows is currently broken in scikit-build
28-
- arch: auto64
29-
python_tag: "pp37-*"
30-
- arch: auto64
62+
# ARM64 only supported only supported on cpython >= 3.9
63+
- arch: ARM64
3164
python_tag: "pp38-*"
65+
- arch: ARM64
66+
python_tag: "pp39-*"
67+
- arch: ARM64
68+
python_tag: "cp38-*"
3269
env:
3370
CIBW_BUILD: ${{matrix.python_tag}}
3471
CIBW_ARCHS: ${{matrix.arch}}
72+
CIBW_TEST_SKIP: "*-win32"
3573
CIBW_TEST_REQUIRES: pytest
3674
CIBW_TEST_COMMAND: pytest {package}/tests
3775
CIBW_BUILD_VERBOSITY: 3
3876

3977
steps:
40-
- uses: actions/checkout@v2
78+
- uses: actions/download-artifact@v3
4179
with:
42-
submodules: 'true'
80+
name: artifact
81+
path: dist
4382

44-
- uses: actions/setup-python@v2
83+
- name: Copy wheel
84+
run: copy dist/*.tar.gz cydifflib.tar.gz
85+
86+
- uses: actions/setup-python@v4
4587

4688
- name: Build wheels
47-
uses: pypa/cibuildwheel@v2.3.1
89+
uses: pypa/cibuildwheel@v2.15.0
4890
with:
91+
package-dir: cydifflib.tar.gz
4992
output-dir: wheelhouse
5093

5194
- name: Upload wheels
52-
uses: actions/upload-artifact@v2
95+
uses: actions/upload-artifact@v3
5396
with:
5497
path: ./wheelhouse/*.whl
5598

5699
build_wheels_macos:
57100
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
101+
needs: [build_sdist]
58102
runs-on: macos-latest
59103
strategy:
60104
fail-fast: false
61105
matrix:
62106
arch: [x86_64, arm64, universal2]
63-
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
107+
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
64108
exclude:
65-
# MacOS Arm only supported since Python 3.8
109+
# PyPy not supported on MacOS Arm
66110
- arch: arm64
67-
python_tag: "cp36-*"
111+
python_tag: "pp38-*"
68112
- arch: arm64
69-
python_tag: "cp37-*"
113+
python_tag: "pp39-*"
70114
- arch: universal2
71-
python_tag: "cp36-*"
115+
python_tag: "pp38-*"
72116
- arch: universal2
73-
python_tag: "cp37-*"
117+
python_tag: "pp39-*"
74118
env:
75119
CIBW_BUILD: ${{matrix.python_tag}}
76120
CIBW_ARCHS: ${{matrix.arch}}
121+
CIBW_TEST_SKIP: "{*-macosx_{arm64,universal2},pp*-macosx_*}"
77122
CIBW_TEST_REQUIRES: pytest
78123
CIBW_TEST_COMMAND: pytest {package}/tests
79124
CIBW_BUILD_VERBOSITY: 3
80125

81126
steps:
82-
- uses: actions/checkout@v2
127+
- uses: actions/download-artifact@v3
83128
with:
84-
submodules: 'true'
129+
name: artifact
130+
path: dist
85131

86-
- uses: actions/setup-python@v2
132+
- uses: actions/setup-python@v4
133+
134+
- name: Copy wheel
135+
run: cp dist/*.tar.gz cydifflib.tar.gz
87136

88137
- name: Build wheels
89-
uses: pypa/cibuildwheel@v2.3.1
138+
uses: pypa/cibuildwheel@v2.15.0
90139
with:
140+
package-dir: cydifflib.tar.gz
91141
output-dir: wheelhouse
92142

93143
- name: Upload wheels
94-
uses: actions/upload-artifact@v2
144+
uses: actions/upload-artifact@v3
95145
with:
96146
path: ./wheelhouse/*.whl
97147

98148
build_wheels_linux:
99149
name: Build wheels on ubuntu-latest/${{matrix.arch}}/${{matrix.python_tag}}
150+
needs: [build_sdist]
100151
runs-on: ubuntu-latest
101152
strategy:
102153
fail-fast: false
103154
matrix:
104-
# disable s390x and ppc64le wheels while they are not provided by numpy
105-
# arch: [auto, aarch64, ppc64le, s390x]
106-
arch: [auto, aarch64]
107-
python_tag: [ "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "pp37-*", "pp38-*"]
155+
arch: [auto, aarch64, ppc64le, s390x]
156+
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
157+
exclude:
158+
# PyPy builds not available for these platforms
159+
- arch: ppc64le
160+
python_tag: "pp38-*"
161+
- arch: ppc64le
162+
python_tag: "pp39-*"
163+
- arch: s390x
164+
python_tag: "pp38-*"
165+
- arch: s390x
166+
python_tag: "pp39-*"
108167
env:
109168
CIBW_ARCHS_LINUX: ${{matrix.arch}}
110169
CIBW_BUILD: ${{matrix.python_tag}}
111-
CIBW_SKIP: "*musllinux_*"
112-
CIBW_TEST_SKIP: "*-manylinux_{aarch64,ppc64le,s390x}"
170+
CIBW_TEST_SKIP: "{*_{aarch64,ppc64le,s390x},*musllinux_*,pp38-*}"
113171
CIBW_TEST_REQUIRES: pytest
114172
CIBW_TEST_COMMAND: pytest {package}/tests
115173
CIBW_BUILD_VERBOSITY: 3
116174

117175
steps:
118-
- uses: actions/checkout@v2
176+
- uses: actions/download-artifact@v3
119177
with:
120-
submodules: 'true'
178+
name: artifact
179+
path: dist
180+
181+
- uses: actions/setup-python@v4
121182

122-
- uses: actions/setup-python@v2
183+
- name: Copy wheel
184+
run: cp dist/*.tar.gz cydifflib.tar.gz
123185

124-
- uses: docker/setup-qemu-action@v1
186+
- uses: docker/setup-qemu-action@v2
125187
name: Set up QEMU
126188

127189
- name: Build wheel
128-
uses: pypa/cibuildwheel@v2.3.1
190+
uses: pypa/cibuildwheel@v2.15.0
129191
with:
192+
package-dir: cydifflib.tar.gz
130193
output-dir: wheelhouse
131194

132195
- name: Upload wheels
133-
uses: actions/upload-artifact@v2
196+
uses: actions/upload-artifact@v3
134197
with:
135198
path: ./wheelhouse/*.whl
136199

137-
build_sdist:
138-
name: Build source distribution
139-
runs-on: ubuntu-latest
140-
steps:
141-
- uses: actions/checkout@v2
142-
with:
143-
submodules: 'true'
144-
145-
- uses: actions/setup-python@v2
146-
147-
- name: Install dependencies
148-
run: |
149-
python -m pip install --upgrade pip
150-
pip install Cython==3.0.0b02
151-
152-
# The cythonized files allow installation from the sdist without cython
153-
- name: Generate cython
154-
run: |
155-
chmod +x ./src/cython/generate.sh
156-
./src/cython/generate.sh
157-
158-
- name: Build sdist
159-
run: |
160-
pip3 install build; python3 -m build --sdist
161-
# test whether tarball contains all files required for compiling
162-
pip3 install dist/cydifflib-*.tar.gz
163-
pip3 uninstall cydifflib --yes
164-
165-
- uses: actions/upload-artifact@v2
166-
with:
167-
path: dist/*.tar.gz
168-
169200
deploy-wheels:
170201
if: github.event_name == 'release' && github.event.action == 'published'
171202
needs: [build_wheels_windows, build_wheels_macos, build_wheels_linux, build_sdist]
172203
name: deploy wheels to pypi
173-
runs-on: ubuntu-18.04
204+
runs-on: ubuntu-latest
205+
environment: pypi-release
206+
permissions:
207+
id-token: write
174208

175209
steps:
176-
- uses: actions/download-artifact@v2
210+
- uses: actions/download-artifact@v3
177211
with:
178212
name: artifact
179213
path: dist
180214

181-
- uses: pypa/gh-action-pypi-publish@master
182-
with:
183-
user: __token__
184-
password: ${{ secrets.pypi_password }}
215+
- uses: pypa/[email protected]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ bench_results/
2929
*.cxx
3030

3131
# temp files from benchmarks
32-
bench/temp/
32+
bench/temp/

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,3 @@ repos:
128128
language: pygrep
129129
entry: PyBind|Numpy|Cmake|CCache|PyTest
130130
exclude: ^\.pre-commit-config.yaml$
131-

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="cydifflib",
10-
version="1.0.1",
10+
version="1.1.0",
1111
url="https://github.com/rapidfuzz/cydifflib",
1212
author="Max Bachmann",
1313
author_email="[email protected]",
@@ -28,5 +28,5 @@
2828
package_dir={"": "src"},
2929
zip_safe=True,
3030
include_package_data=True,
31-
python_requires=">=3.6",
31+
python_requires=">=3.8",
3232
)

0 commit comments

Comments
 (0)