Skip to content

Commit 4db469a

Browse files
committed
build linux aarch64 wheels, closes #162
1 parent adfb0bd commit 4db469a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/build_and_upload.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: "pypa/cibuildwheel@v2.21.1"
2424
env:
2525
CIBW_SKIP: "pp*" # FIXME
26+
CIBW_ARCHS_LINUX: "auto aarch64"
2627
CIBW_TEST_REQUIRES: "pytest"
2728
CIBW_TEST_COMMAND: "pytest {project}/tests --doctest-modules"
2829
- uses: "actions/upload-artifact@v3"

setup.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
from Cython.Build import cythonize
77
from setuptools import Extension, setup
88

9-
sources = ["pycrfsuite/_pycrfsuite.pyx",
10-
"pycrfsuite/trainer_wrapper.cpp"]
9+
sources = ["pycrfsuite/_pycrfsuite.pyx", "pycrfsuite/trainer_wrapper.cpp"]
1110

1211
# crfsuite
1312
sources += glob.glob("crfsuite/lib/crf/src/*.c")
@@ -34,12 +33,17 @@ def build_extensions(self):
3433
_compile = c._compile
3534

3635
def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
37-
cc_args = cc_args + ["-D_POSIX_C_SOURCE=200112L"] if src.startswith("crfsuite/") else cc_args
36+
cc_args = (
37+
cc_args + ["-D_POSIX_C_SOURCE=200112L"]
38+
if src.startswith("crfsuite/")
39+
else cc_args
40+
)
3841
cc_args = cc_args + ["-std=c99"] if src.endswith(".c") else cc_args
3942
return _compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
4043

41-
if c.compiler_type == "unix" and \
42-
any(item == "gcc" or item.endswith("-gcc") for item in c.compiler):
44+
if c.compiler_type == "unix" and any(
45+
item == "gcc" or item.endswith("-gcc") for item in c.compiler
46+
):
4347
c._compile = c_compile
4448

4549
elif self.compiler.compiler_type == "msvc":
@@ -60,5 +64,5 @@ def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
6064
)
6165
]
6266
),
63-
cmdclass={"build_ext": build_ext_check_gcc}
67+
cmdclass={"build_ext": build_ext_check_gcc},
6468
)

0 commit comments

Comments
 (0)