Skip to content

Commit

Permalink
Merge branch 'master' of github.com:litagin02/pyopenjtalk
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Jul 29, 2024
2 parents a3e2115 + 524e331 commit e0aefdd
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 3 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/hts_engine_API
8 changes: 8 additions & 0 deletions pyopenjtalk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0aefdd

Please sign in to comment.