diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..549f011 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,88 @@ +# ref: https://github.com/tsukumijima/pyworld-prebuilt/blob/master/.github/workflows/build-wheels.yml +name: Deploy to PyPI + +on: + workflow_dispatch: + inputs: + publish_pypi: + type: boolean + required: true + description: 'Publish to PyPI (Production)' + +jobs: + build_wheels: + strategy: + matrix: + os: [windows-2022, macos-11, ubuntu-22.04] + runs-on: ${{ matrix.os }} + name: Build Wheels on ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Build Wheels + uses: pypa/cibuildwheel@v2.16.5 + env: + CIBW_ARCHS_LINUX: auto aarch64 + CIBW_ARCHS_MACOS: x86_64 universal2 arm64 + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" + CIBW_SKIP: pp* *musllinux* + + - name: Upload Wheels to artifact + uses: actions/upload-artifact@v4 + with: + name: cibuildwheel-wheels-${{ runner.os }} + path: wheelhouse + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibuildwheel-sdist + path: dist/*.tar.gz + + publish_wheels: + runs-on: ubuntu-22.04 + needs: [build_wheels, build_sdist] + name: Publish Wheels + steps: + + - name: Download Wheels from artifact + uses: actions/download-artifact@v4 + with: + pattern: cibuildwheel-* + path: wheelhouse + merge-multiple: true + + - name: Publish Wheels to Test PyPI + if: ${{ github.event.inputs.publish_pypi == 'false' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: wheelhouse + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + + - name: Publish Wheels to PyPI + if: ${{ github.event.inputs.publish_pypi == 'true' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: wheelhouse + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.gitmodules b/.gitmodules index e70e7ee..3414535 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/r9y9/open_jtalk.git [submodule "lib/hts_engine_API"] path = lib/hts_engine_API - url = https://github.com/r9y9/hts_engine_API.git + url = https://github.com/syoyo/hts_engine_API.git diff --git a/lib/hts_engine_API b/lib/hts_engine_API index 214e26d..2821c7a 160000 --- a/lib/hts_engine_API +++ b/lib/hts_engine_API @@ -1 +1 @@ -Subproject commit 214e26dfb7f728ff9db39c14a59db709abcc121d +Subproject commit 2821c7a0b02441af42b642365296a35a5c9f0784 diff --git a/pyopenjtalk/__init__.py b/pyopenjtalk/__init__.py index abf503a..5e8edc5 100644 --- a/pyopenjtalk/__init__.py +++ b/pyopenjtalk/__init__.py @@ -264,3 +264,11 @@ def update_global_jtalk_with_user_dict(path): _global_jtalk = OpenJTalk( dn_mecab=OPEN_JTALK_DICT_DIR, userdic=path.encode("utf-8") ) + + +def unset_user_dict(): + """Stop applying user dictionary""" + global _global_jtalk + if _global_jtalk is None: + _lazy_init() + _global_jtalk = OpenJTalk(dn_mecab=OPEN_JTALK_DICT_DIR) diff --git a/setup.py b/setup.py index c232c71..e11d4f8 100644 --- a/setup.py +++ b/setup.py @@ -166,7 +166,7 @@ def check_cmake_in_path(): .decode("ascii") .strip() ) - version += "+" + sha[:7] + # version += "+" + sha[:7] except subprocess.CalledProcessError: pass except IOError: # FileNotFoundError for python 3