Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2020-10-22 03:49:33 +0300
committerTaku Kudo <taku@google.com>2020-10-22 03:49:33 +0300
commitd8c4b0405649d788a46744c646be85d83823f01c (patch)
treee43c00f783d0d52dc62b1ff4f4cde1fdb427329e
parent9dee6649ae40bb14617f63c4afeb36857582856b (diff)
Fixed build error on Mac.
-rw-r--r--.gitignore1
-rw-r--r--python/MANIFEST.in4
-rwxr-xr-xpython/make_py_wheel.sh2
-rwxr-xr-xpython/setup.py8
4 files changed, 9 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 367bdb8..20073e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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):