diff --git a/.github/workflows/build-pip.yml b/.github/workflows/build-pip.yml index 9a9c96b..618512e 100644 --- a/.github/workflows/build-pip.yml +++ b/.github/workflows/build-pip.yml @@ -34,7 +34,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm, macos-13] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] fail-fast: false steps: @@ -45,11 +45,6 @@ jobs: with: key: ${{ matrix.os }}-${{ matrix.python-version }} - # see https://github.com/microsoft/setup-msbuild - - name: Add msbuild to PATH - if: startsWith(matrix.os, 'windows') - uses: microsoft/setup-msbuild@v1.0.2 - - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/build-wheels-aarch64.yaml b/.github/workflows/build-wheels-aarch64.yaml index 19916f1..3f1abb3 100644 --- a/.github/workflows/build-wheels-aarch64.yaml +++ b/.github/workflows/build-wheels-aarch64.yaml @@ -21,34 +21,32 @@ jobs: name: ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest] - python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] + os: [ubuntu-24.04-arm] + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: all - # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v3.1.4 env: CIBW_BUILD: "${{ matrix.python-version}}-* " CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" CIBW_BUILD_VERBOSITY: 3 CIBW_ARCHS_LINUX: aarch64 - CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-aarch64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-312/kaldi_decoder/lib' + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-aarch64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-313/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-314/kaldi_decoder/lib' - name: Display wheels shell: bash run: | ls -lh ./wheelhouse/ + unzip -l ./wheelhouse/*.whl + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.python-version }} @@ -60,6 +58,6 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python3 -m pip install --upgrade pip - python3 -m pip install wheel twine setuptools + python3 -m pip install wheel twine==5.0.0 setuptools twine upload ./wheelhouse/*.whl diff --git a/.github/workflows/build-wheels-linux.yaml b/.github/workflows/build-wheels-linux.yaml index d8a418c..863d8e4 100644 --- a/.github/workflows/build-wheels-linux.yaml +++ b/.github/workflows/build-wheels-linux.yaml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 @@ -29,17 +29,18 @@ jobs: # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v3.1.4 env: CIBW_BUILD: "${{ matrix.python-version}}-* " CIBW_SKIP: "cp27-* cp35-* cp36-* pp* *-musllinux* *-win32 " CIBW_BUILD_VERBOSITY: 3 - CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-x86_64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-312/kaldi_decoder/lib' + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-x86_64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-313/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-314/kaldi_decoder/lib' - name: Display wheels shell: bash run: | ls -lh ./wheelhouse/ + unzip -l ./wheelhouse/*.whl - uses: actions/upload-artifact@v4 with: @@ -52,7 +53,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python3 -m pip install --upgrade pip - python3 -m pip install wheel twine setuptools + python3 -m pip install wheel twine==5.0.0 setuptools twine upload ./wheelhouse/*.whl diff --git a/.github/workflows/build-wheels-macos.yaml b/.github/workflows/build-wheels-macos.yaml index ac1f19c..2ba2788 100644 --- a/.github/workflows/build-wheels-macos.yaml +++ b/.github/workflows/build-wheels-macos.yaml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: os: [macos-latest] - python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 @@ -32,10 +32,13 @@ jobs: # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v3.1.4 env: CIBW_BUILD: "${{ matrix.python-version}}-* " - CIBW_ENVIRONMENT: KALDI_DECODER_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'" + CIBW_ENVIRONMENT: > + KALDI_DECODER_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15" + MACOSX_DEPLOYMENT_TARGET=10.15 + CIBW_ARCHS: "universal2" CIBW_BUILD_VERBOSITY: 3 @@ -59,6 +62,6 @@ jobs: run: | opts='--break-system-packages' python3 -m pip install $opts --upgrade pip - python3 -m pip install $opts wheel twine setuptools + python3 -m pip install $opts wheel twine==5.0.0 setuptools twine upload ./wheelhouse/*.whl diff --git a/.github/workflows/build-wheels-win32.yaml b/.github/workflows/build-wheels-win32.yaml index 0730996..3a29529 100644 --- a/.github/workflows/build-wheels-win32.yaml +++ b/.github/workflows/build-wheels-win32.yaml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 @@ -29,7 +29,7 @@ jobs: # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v3.1.4 env: CIBW_ENVIRONMENT: KALDI_DECODER_CMAKE_ARGS="-A Win32" CIBW_BUILD: "${{ matrix.python-version}}-* " @@ -52,6 +52,6 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python3 -m pip install --upgrade pip - python3 -m pip install wheel twine setuptools + python3 -m pip install wheel twine==5.0.0 setuptools twine upload ./wheelhouse/*.whl diff --git a/.github/workflows/build-wheels-win64.yaml b/.github/workflows/build-wheels-win64.yaml index a51c472..d848b06 100644 --- a/.github/workflows/build-wheels-win64.yaml +++ b/.github/workflows/build-wheels-win64.yaml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 @@ -29,10 +29,10 @@ jobs: # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v3.1.4 env: CIBW_BUILD: "${{ matrix.python-version}}-* " - CIBW_SKIP: "cp27-* cp35-* cp36-* pp* *-musllinux* *-win32 " + CIBW_SKIP: "cp27-* cp35-* cp36-* cp37-* pp* *-musllinux* *-win32 " CIBW_BUILD_VERBOSITY: 3 - name: Display wheels @@ -51,6 +51,6 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python3 -m pip install --upgrade pip - python3 -m pip install wheel twine setuptools + python3 -m pip install wheel twine==5.0.0 setuptools twine upload ./wheelhouse/*.whl diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 4ea6a91..e4f9003 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, ubuntu-24.04-arm] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 608dbb6..f8e4182 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest] + os: [macos-latest, macos-13] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index 743ed0c..1ca27dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") cmake_policy(SET CMP0135 NEW) endif() -set(KALDI_DECODER_VERSION "0.2.7") +set(KALDI_DECODER_VERSION "0.2.10") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") @@ -35,7 +35,7 @@ if(NOT CMAKE_BUILD_TYPE) endif() message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ version to be used.") +set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ version to be used.") set(CMAKE_CXX_EXTENSIONS OFF) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) diff --git a/cmake/kaldifst.cmake b/cmake/kaldifst.cmake index be7e4a9..da5f741 100644 --- a/cmake/kaldifst.cmake +++ b/cmake/kaldifst.cmake @@ -1,18 +1,17 @@ function(download_kaldifst) include(FetchContent) - set(kaldifst_URL "https://github.com/k2-fsa/kaldifst/archive/refs/tags/v1.7.11.tar.gz") - set(kaldifst_URL2 "https://hub.nuaa.cf/k2-fsa/kaldifst/archive/refs/tags/v1.7.11.tar.gz") - set(kaldifst_HASH "SHA256=b43b3332faa2961edc730e47995a58cd4e22ead21905d55b0c4a41375b4a525f") + set(kaldifst_URL "https://github.com/k2-fsa/kaldifst/archive/refs/tags/v1.7.16.tar.gz") + set(kaldifst_HASH "SHA256=f338135a3d137b7a8c287e2ca2e0918e1394e1c08bad53b26e7be03a5d4a1066") # If you don't have access to the Internet, # please pre-download kaldifst set(possible_file_locations - $ENV{HOME}/Downloads/kaldifst-1.7.11.tar.gz - ${CMAKE_SOURCE_DIR}/kaldifst-1.7.11.tar.gz - ${CMAKE_BINARY_DIR}/kaldifst-1.7.11.tar.gz - /tmp/kaldifst-1.7.11.tar.gz - /star-fj/fangjun/download/github/kaldifst-1.7.11.tar.gz + $ENV{HOME}/Downloads/kaldifst-1.7.16.tar.gz + ${CMAKE_SOURCE_DIR}/kaldifst-1.7.16.tar.gz + ${CMAKE_BINARY_DIR}/kaldifst-1.7.16.tar.gz + /tmp/kaldifst-1.7.16.tar.gz + /star-fj/fangjun/download/github/kaldifst-1.7.16.tar.gz ) foreach(f IN LISTS possible_file_locations) @@ -20,7 +19,6 @@ function(download_kaldifst) set(kaldifst_URL "${f}") file(TO_CMAKE_PATH "${kaldifst_URL}" kaldifst_URL) message(STATUS "Found local downloaded kaldifst: ${kaldifst_URL}") - set(kaldifst_URL2) break() endif() endforeach() diff --git a/cmake/pybind11.cmake b/cmake/pybind11.cmake index 55fabb6..fa66ae5 100644 --- a/cmake/pybind11.cmake +++ b/cmake/pybind11.cmake @@ -1,18 +1,18 @@ function(download_pybind11) include(FetchContent) - set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz") - set(pybind11_URL2 "https://hub.nuaa.cf/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz") - set(pybind11_HASH "SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae") + set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v3.0.0.tar.gz") + set(pybind11_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/pybind11-3.0.0.tar.gz") + set(pybind11_HASH "SHA256=453b1a3e2b266c3ae9da872411cadb6d693ac18063bd73226d96cfb7015a200c") # If you don't have access to the Internet, # please pre-download pybind11 set(possible_file_locations - $ENV{HOME}/Downloads/pybind11-2.10.2.tar.gz - ${CMAKE_SOURCE_DIR}/pybind11-2.10.2.tar.gz - ${CMAKE_BINARY_DIR}/pybind11-2.10.2.tar.gz - /tmp/pybind11-2.10.2.tar.gz - /star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz + $ENV{HOME}/Downloads/pybind11-3.0.0.tar.gz + ${CMAKE_SOURCE_DIR}/pybind11-3.0.0.tar.gz + ${CMAKE_BINARY_DIR}/pybind11-3.0.0.tar.gz + /tmp/pybind11-3.0.0.tar.gz + /star-fj/fangjun/download/github/pybind11-3.0.0.tar.gz ) foreach(f IN LISTS possible_file_locations) diff --git a/setup.py b/setup.py index 98b5c62..c034fb2 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ def get_package_version(): setuptools.setup( name=package_name, - python_requires=">=3.6", + python_requires=">=3.8", version=get_package_version(), author="The next-gen Kaldi development team", author_email="csukuangfj@gmail.com", @@ -56,7 +56,7 @@ def get_package_version(): "Programming Language :: Python", "Topic :: Scientific/Engineering :: Artificial Intelligence", ], - license="Apache licensed, as found in the LICENSE file", + license="Apache-2.0", ) with open("kaldi-decoder/python/kaldi_decoder/__init__.py", "r") as f: