diff options
author | Taku Kudo <taku@google.com> | 2020-10-22 03:49:33 +0300 |
---|---|---|
committer | Taku Kudo <taku@google.com> | 2020-10-22 03:49:33 +0300 |
commit | d8c4b0405649d788a46744c646be85d83823f01c (patch) | |
tree | e43c00f783d0d52dc62b1ff4f4cde1fdb427329e | |
parent | 9dee6649ae40bb14617f63c4afeb36857582856b (diff) |
Fixed build error on Mac.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python/MANIFEST.in | 4 | ||||
-rwxr-xr-x | python/make_py_wheel.sh | 2 | ||||
-rwxr-xr-x | python/setup.py | 8 |
4 files changed, 9 insertions, 6 deletions
@@ -70,3 +70,4 @@ m.vocab cmake_install.cmake libsentencepiece.so* libsentencepiece_train.so* +python/bundled diff --git a/python/MANIFEST.in b/python/MANIFEST.in index 9d9603f..c182f30 100644 --- a/python/MANIFEST.in +++ b/python/MANIFEST.in @@ -1,3 +1,3 @@ recursive-include test *.py *.model botchan.txt -include *.i *.md VERSION -include build_bundled.sh +recursive-include src *.i +include *.md VERSION build_bundled.sh diff --git a/python/make_py_wheel.sh b/python/make_py_wheel.sh index 303eef3..79aeb45 100755 --- a/python/make_py_wheel.sh +++ b/python/make_py_wheel.sh @@ -42,7 +42,7 @@ build() { for i in /opt/python/* do $i/bin/python setup.py bdist - strip build/*/*.so + strip build/*/*/*.so $i/bin/python setup.py bdist_wheel $i/bin/python setup.py test rm -fr build diff --git a/python/setup.py b/python/setup.py index e223fea..1e9bf07 100755 --- a/python/setup.py +++ b/python/setup.py @@ -53,9 +53,11 @@ def run_pkg_config(section, pkg_config_path=None): def is_sentencepiece_installed(): - return subprocess.run( - 'pkg-config sentencepiece --libs', shell=True, - check=False).returncode == 0 + try: + subprocess.check_call('pkg-config sentencepiece --libs', shell=True) + return True + except subprocess.CalledProcessError: + return False class build_ext(_build_ext): |