Skip to content

Commit

Permalink
[workflow] fix wheels (#1576)
Browse files Browse the repository at this point in the history
* [workflow] fix wheels

* [binding] fix lint
  • Loading branch information
pengzhendong authored Nov 23, 2022
1 parent 7137ba7 commit d809f1d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ jobs:
python-version: '3.6'

- name: Build wheels
uses: pypa/cibuildwheel@v2.5.0
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*"
# Disable building PyPy wheels on all platforms
# Skip 32-bit builds
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux_*"

CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so -w {dest_dir} {wheel}
# For MacOS, please see: https://github.com/pypa/cibuildwheel/issues/816
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
REPAIR_LIBRARY_PATH=$FC_BASE_DIR/libtorch-src/lib:$FC_BASE_DIR/openfst-subbuild/openfst-populate-prefix/lib &&
REPAIR_LIBRARY_PATH=$FC_BASE_DIR/libtorch-src/lib &&
DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} &&
DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
with:
Expand Down
3 changes: 1 addition & 2 deletions examples/aishell/s0/path.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export WENET_DIR=$PWD/../../..
export BUILD_DIR=${WENET_DIR}/runtime/libtorch/build
export OPENFST_PREFIX_DIR=${BUILD_DIR}/../fc_base/openfst-subbuild/openfst-populate-prefix
export OPENFST_BIN=${BUILD_DIR}/../fc_base/openfst-build/src
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_PREFIX_DIR}/bin:${OPENFST_BIN}/bin:$PATH
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_BIN}/bin:$PATH

# NOTE(kan-bayashi): Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
Expand Down
3 changes: 1 addition & 2 deletions examples/aishell2/s0/path.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export WENET_DIR=$PWD/../../..
export BUILD_DIR=${WENET_DIR}/runtime/libtorch/build
export OPENFST_PREFIX_DIR=${BUILD_DIR}/../fc_base/openfst-subbuild/openfst-populate-prefix
export OPENFST_BIN=${BUILD_DIR}/../fc_base/openfst-build/src
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_PREFIX_DIR}/bin:${OPENFST_BIN}/bin:$PATH
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_BIN}/bin:$PATH

# NOTE(kan-bayashi): Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
Expand Down
3 changes: 1 addition & 2 deletions examples/librispeech/s0/path.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export WENET_DIR=$PWD/../../..
export BUILD_DIR=${WENET_DIR}/runtime/libtorch/build
export OPENFST_PREFIX_DIR=${BUILD_DIR}/../fc_base/openfst-subbuild/openfst-populate-prefix
export OPENFST_BIN=${BUILD_DIR}/../fc_base/openfst-build/src
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_PREFIX_DIR}/bin:${OPENFST_BIN}/bin:$PATH
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_BIN}/bin:$PATH

# NOTE(kan-bayashi): Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
Expand Down
13 changes: 4 additions & 9 deletions runtime/binding/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

import glob
import os
import platform
import shutil
import sys

import setuptools
from setuptools.command.build_ext import build_ext


def is_windows():
return platform.system() == "Windows"


def cmake_extension(name, *args, **kwargs) -> setuptools.Extension:
kwargs["language"] = "c++"
sources = []
Expand Down Expand Up @@ -70,7 +65,7 @@ def read_long_description():

setuptools.setup(
name=package_name,
version='1.0.9',
version='1.0.10',
author="Binbin Zhang",
author_email="binbzha@qq.com",
package_dir={
Expand All @@ -83,13 +78,13 @@ def read_long_description():
ext_modules=[cmake_extension("_wenet")],
cmdclass={"build_ext": BuildExtension},
zip_safe=False,
setup_requires=["torch", "tqdm"],
setup_requires=["tqdm"],
install_requires=["torch", "tqdm"],
classifiers=[
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
license="Apache licensed, as found in the LICENSE file",
python_requires=">=3.6",
)

0 comments on commit d809f1d

Please sign in to comment.