From 29fcc041ea5b74cc6971a346f3e62319f778655e Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 14:20:00 -0500 Subject: [PATCH 1/8] feat: flush stdout everywhere (fixes #371) --- programs/pocketsphinx_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/pocketsphinx_main.c b/programs/pocketsphinx_main.c index c0ef64381..c202a67a7 100644 --- a/programs/pocketsphinx_main.c +++ b/programs/pocketsphinx_main.c @@ -338,6 +338,7 @@ output_hyp(ps_endpointer_t *ep, ps_decoder_t *decoder, ps_alignment_t *alignment --maxlen; *ptr = '\0'; puts(hyp_json); + fflush(stdout); ckd_free(hyp_json); } @@ -716,6 +717,7 @@ print_config(ps_config_t *config) { if (puts(ps_config_serialize_json(config)) < 0) return -1; + fflush(stdout); return 0; } From 94e756cb90934e50dd23692cb6f6e071393ad314 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 14:20:11 -0500 Subject: [PATCH 2/8] docs: add classifiers --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a8731358a..5306e4b53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ keywords = ["asr", "speech"] classifiers = [ "Development Status :: 6 - Mature", "Programming Language :: C", + "Programming Language :: Cython", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -25,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", + "Topic :: Multimedia :: Sound/Audio :: Speech", ] [project.urls] From c2e0649f0d711a328cb6fc10dc510fcde4f04b16 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 14:36:29 -0500 Subject: [PATCH 3/8] fix(ci): new cibuildwheel config --- .github/dependabot.yml | 6 ++++++ .github/workflows/build_wheels.yml | 12 ++++++------ pyproject.toml | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..5ace4600a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0e4149a2c..ba506ab08 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build SDist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz @@ -25,16 +25,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2019, macos-11] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build wheels - uses: pypa/cibuildwheel@v2.12.3 + uses: pypa/cibuildwheel@v2.16.2 - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl diff --git a/pyproject.toml b/pyproject.toml index 5306e4b53..1c12c83e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,19 +36,19 @@ Repository = "https://github.com/cmusphinx/pocketsphinx.git" Issues = "https://github.com/cmusphinx/pocketsphinx/issues" [tool.cibuildwheel] -# Build the versions found in Ubuntu LTS, the stable PyPy, and 3.10 -# everywhere else +# Build a reduced selection of binaries as there are tons of them build = [ - "pp38*", - "cp36-manylinux_*", - "cp38-manylinux_*", + "pp310*", + "cp38-*", "cp310-*", - "cp311-*" + "cp311-*", + "cp312-*", +] +# Build only universal wheels for Mac +skip = [ + "cp*-macosx_x86_64", + "cp*-macosx_arm64", ] -# PyPy 3.8 will choke on CPython 3.8 build leftovers... -before-build = "rm -rf _skbuild" -# PyPy builds are broken on Windows, and skip 32-bit and musl -skip = ["*musl*", "*_i686", "*-win32", "pp*win*"] [tool.isort] profile = "black" From 1b136934ba50a0869c2cda1b4ebd9115e0a06f1b Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 14:46:41 -0500 Subject: [PATCH 4/8] fix(ci): tweak cibuildwheel a bit --- .github/workflows/build_wheels.yml | 6 +++--- pyproject.toml | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index ba506ab08..db450c0ad 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -2,7 +2,7 @@ name: Build on: push: branches: - master + - master workflow_dispatch: jobs: @@ -16,7 +16,7 @@ jobs: - name: Build SDist run: pipx run build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: path: dist/*.tar.gz @@ -35,6 +35,6 @@ jobs: uses: pypa/cibuildwheel@v2.16.2 - name: Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl diff --git a/pyproject.toml b/pyproject.toml index 1c12c83e1..e34515858 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,12 +44,15 @@ build = [ "cp311-*", "cp312-*", ] -# Build only universal wheels for Mac +# Build only universal wheels for Mac where possible skip = [ "cp*-macosx_x86_64", "cp*-macosx_arm64", ] +[tool.cibuildwheel.macos] +archs = ["x86_64", "universal2", "arm64"] + [tool.isort] profile = "black" From 064c465cd746b94a36d6308c409edb84a2783f5a Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 15:25:05 -0500 Subject: [PATCH 5/8] fix(deps): include sounddevice --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e34515858..073f8e30a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ authors = [ {name = "David Huggins-Daines", email = "dhdaines@gmail.com"} ] keywords = ["asr", "speech"] +dependencies = ["sounddevice"] classifiers = [ "Development Status :: 6 - Mature", "Programming Language :: C", From 0f1f7a40dd95d023f38304e0d184ee84738b32ca Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 16:15:10 -0500 Subject: [PATCH 6/8] chore: bump versions and such --- .gitignore | 2 +- CMakeLists.txt | 2 +- MANIFEST.in | 1 + NEWS | 6 ++++-- README.md | 2 +- cython/README.md | 2 +- docs/source/conf.py | 4 ++-- doxygen/CMakeLists.txt | 2 +- include/pocketsphinx.h | 4 ++-- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 6d2dbdd2d..b07826f89 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,5 @@ CMakeFiles CTestTestfile.cmake DartConfiguration.tcl cmake_install.cmake - +venv/ .tox diff --git a/CMakeLists.txt b/CMakeLists.txt index e363bbd0f..ce7eb35eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14) # I like pie -project(PocketSphinx VERSION 5.0.2 +project(PocketSphinx VERSION 5.0.3 DESCRIPTION "A small speech recognizer" HOMEPAGE_URL "https://github.com/cmusphinx/pocketsphinx" LANGUAGES C) diff --git a/MANIFEST.in b/MANIFEST.in index 414beadf8..2e81f3fb6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -45,3 +45,4 @@ recursive-exclude * *.DS_Store recursive-exclude * __pycache__ recursive-exclude * *.so recursive-exclude * *.egg-info +recursive-exclude venv * \ No newline at end of file diff --git a/NEWS b/NEWS index c3b44d84e..343caea0b 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ -PocketSphinx 5.0.0 +PocketSphinx 5.0.3 ^^^^^^^^^^^^^^^^^^ -Not released yet! +The NEWS file has not been updated for some time. See the GitHub +releases page at https://github.com/cmusphinx/pocketsphinx/releases +instead. Pocketsphinx 0.8 ^^^^^^^^^^^^^^^^ diff --git a/README.md b/README.md index 8fd80bdbc..d0883dd07 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -PocketSphinx 5.0.2 +PocketSphinx 5.0.3 ================== This is PocketSphinx, one of Carnegie Mellon University's open source large diff --git a/cython/README.md b/cython/README.md index 7b45ce629..bc390f927 100644 --- a/cython/README.md +++ b/cython/README.md @@ -1,4 +1,4 @@ -PocketSphinx 5.0.2 +PocketSphinx 5.0.3 ================== This is PocketSphinx, one of Carnegie Mellon University's open source large diff --git a/docs/source/conf.py b/docs/source/conf.py index c1a7be042..1626c76f2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = 'PocketSphinx' -copyright = '2022, David Huggins-Daines' +copyright = '2023, David Huggins-Daines' author = 'David Huggins-Daines' # The full version, including alpha/beta/rc tags -release = '5.0.2' +release = '5.0.3' # -- General configuration --------------------------------------------------- diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt index 7b42f7b65..c392af12e 100644 --- a/doxygen/CMakeLists.txt +++ b/doxygen/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(Doxygen) if(DOXYGEN_FOUND) - set(DOXYGEN_PROJECT_NUMBER 5.0.2) + set(DOXYGEN_PROJECT_NUMBER 5.0.3) set(DOXYGEN_EXAMPLE_PATH ${CMAKE_SOURCE_DIR}/examples) set(DOXYGEN_SORT_MEMBER_DOCS NO) set(DOXYGEN_USE_MATHJAX YES) diff --git a/include/pocketsphinx.h b/include/pocketsphinx.h index 879689aea..4dbcd7b04 100644 --- a/include/pocketsphinx.h +++ b/include/pocketsphinx.h @@ -1095,8 +1095,8 @@ void ps_get_all_time(ps_decoder_t *ps, double *out_nspeech, /** * @mainpage PocketSphinx API Documentation * @author David Huggins-Daines - * @version 5.0.2 - * @date July 31, 2023 + * @version 5.0.3 + * @date December 28, 2023 * * @tableofcontents{HTML:1} * From acae2e1bf57232e3bdaf7b6e81067725ad5d4020 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 16:15:29 -0500 Subject: [PATCH 7/8] fix: run as root in dockerfile so audio can work --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2862c65b2..f7780d67d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest as runtime -RUN apk add --no-cache python3 py3-pip sox +RUN apk add --no-cache python3 py3-pip sox portaudio alsa-utils alsaconf FROM runtime as build RUN apk add --no-cache cmake ninja gcc musl-dev python3-dev pkgconfig @@ -13,10 +13,7 @@ RUN CMAKE_ARGS="-DUSE_INSTALLED_POCKETSPHINX=ON" pip wheel -v . FROM runtime COPY --from=build /usr/local/ /usr/local/ COPY --from=build /pocketsphinx/*.whl / -RUN pip install /*.whl && rm /*.whl +RUN pip install --break-system-packages /*.whl && rm /*.whl -RUN adduser -u 1000 -DHD pocketsphinx && adduser pocketsphinx audio COPY examples/ /work/examples/ -RUN chown -R pocketsphinx:pocketsphinx /work -USER pocketsphinx WORKDIR /work From a61741c08ba161634881059c0f70377ff2b5b801 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 16:15:42 -0500 Subject: [PATCH 8/8] fix(ci): build less stuff --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 073f8e30a..e14b2b8a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,10 +45,13 @@ build = [ "cp311-*", "cp312-*", ] -# Build only universal wheels for Mac where possible +# Build only universal wheels for Mac where possible, and skip 32-bit +# builds to avoid building a gigabyte of stuff all the time skip = [ "cp*-macosx_x86_64", "cp*-macosx_arm64", + "*_i686", + "*-win32", ] [tool.cibuildwheel.macos]