From 0eecd2fc47b3a2cbf38c583d727d0fbb53c9b619 Mon Sep 17 00:00:00 2001 From: iver56 Date: Thu, 21 Dec 2023 11:03:24 +0100 Subject: [PATCH 1/7] Try to build for python 3.10 on Windows --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f152855..4d70180 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ main ] + branches: [ main, ij/python3.10-compat ] jobs: build: @@ -26,7 +26,7 @@ jobs: - name: Build Wheels env: CIBW_ARCHS: "auto64" - CIBW_SKIP: "cp36-* cp37-* cp310-win* cp311-win* cp312-*" + CIBW_SKIP: "cp36-* cp37-* cp311-win* cp312-*" run: | python -m pip install cibuildwheel python -m cibuildwheel --output-dir wheelhouse From 9e63f00527797229462782ebc3795d36591bb87d Mon Sep 17 00:00:00 2001 From: iver56 Date: Thu, 21 Dec 2023 12:16:18 +0100 Subject: [PATCH 2/7] Try to fix the compilation --- fast_align_audio/_faa.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fast_align_audio/_faa.c b/fast_align_audio/_faa.c index 93d5b4f..7f8efb2 100644 --- a/fast_align_audio/_faa.c +++ b/fast_align_audio/_faa.c @@ -2,6 +2,11 @@ #include #include +#ifdef _MSC_VER +#include +typedef SSIZE_T ssize_t; +#endif + #define LARGE_VAL 1e20f static float sum_m256(__m256 x) { From 2806a90ede1e62f8bb5a1afefc04fa562ca096e8 Mon Sep 17 00:00:00 2001 From: iver56 Date: Thu, 21 Dec 2023 12:29:09 +0100 Subject: [PATCH 3/7] Revert temporary build condition --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d70180..62e4614 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ main, ij/python3.10-compat ] + branches: [ main ] jobs: build: From e85ece51e99ba56001cb338d137f8c2bb3929326 Mon Sep 17 00:00:00 2001 From: iver56 Date: Thu, 21 Dec 2023 12:31:45 +0100 Subject: [PATCH 4/7] Add python 3.10 classifier in setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4b55610..2aef859 100644 --- a/setup.py +++ b/setup.py @@ -48,6 +48,7 @@ def find_version(*file_paths): "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], url="https://github.com/nomonosound/fast-align-audio", ) From 3014dd085175871b101f8b273519c9f9c0970842 Mon Sep 17 00:00:00 2001 From: iver56 Date: Fri, 22 Dec 2023 13:12:11 +0100 Subject: [PATCH 5/7] Try to get by without ssize_t --- .github/workflows/build.yml | 2 +- fast_align_audio/_alignment_cffi.py | 2 +- fast_align_audio/_faa.c | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62e4614..4d70180 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ main ] + branches: [ main, ij/python3.10-compat ] jobs: build: diff --git a/fast_align_audio/_alignment_cffi.py b/fast_align_audio/_alignment_cffi.py index c616896..9c26af6 100644 --- a/fast_align_audio/_alignment_cffi.py +++ b/fast_align_audio/_alignment_cffi.py @@ -5,7 +5,7 @@ ffibuilder = FFI() ffibuilder.cdef(""" typedef struct { - ssize_t min_idx; + int min_idx; float min_val; } MinResult; """) diff --git a/fast_align_audio/_faa.c b/fast_align_audio/_faa.c index 7f8efb2..fe3d646 100644 --- a/fast_align_audio/_faa.c +++ b/fast_align_audio/_faa.c @@ -2,11 +2,6 @@ #include #include -#ifdef _MSC_VER -#include -typedef SSIZE_T ssize_t; -#endif - #define LARGE_VAL 1e20f static float sum_m256(__m256 x) { @@ -54,7 +49,7 @@ static size_t my_min3(size_t a, size_t b, size_t c) { } typedef struct { - ssize_t min_idx; + int min_idx; float min_val; } MinResult; @@ -75,7 +70,7 @@ MinResult fast_find_alignment(size_t a_len, float *a, float d2 = fastmse(result.min_val, my_min3(a_len, b_len - i, max_lookahead), a, &b[i]); if (d2 < result.min_val) { result.min_val = d2; - result.min_idx = -(ssize_t)i; + result.min_idx = -i; } } } From 04018bb5ea0135e80701c63f91509241fa42c67c Mon Sep 17 00:00:00 2001 From: iver56 Date: Fri, 22 Dec 2023 13:19:22 +0100 Subject: [PATCH 6/7] Try to enable cp311-win build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d70180..9598a5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Build Wheels env: CIBW_ARCHS: "auto64" - CIBW_SKIP: "cp36-* cp37-* cp311-win* cp312-*" + CIBW_SKIP: "cp36-* cp37-* cp312-*" run: | python -m pip install cibuildwheel python -m cibuildwheel --output-dir wheelhouse From 9bfe55d442b7ea113d3f82046ad4240257f8f73a Mon Sep 17 00:00:00 2001 From: iver56 Date: Fri, 22 Dec 2023 13:19:51 +0100 Subject: [PATCH 7/7] Add python 3.11 classifier in setup.py --- .github/workflows/build.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9598a5e..a624a7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ main, ij/python3.10-compat ] + branches: [ main ] jobs: build: diff --git a/setup.py b/setup.py index 2aef859..2a4d245 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ def find_version(*file_paths): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], url="https://github.com/nomonosound/fast-align-audio", )