提交 eb91ce84 编写于 作者: H huangyuxin

refactor the version

上级 4a133619
......@@ -11,5 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = '0.1.1'
try:
from .version import full_version as __version__
except ImportError:
import sys
sys.stderr.write(
"Warning: import paddlespeech from source directory without installing, run 'python setup.py install' to install paddlespeech firstly\n"
)
......@@ -17,7 +17,6 @@ import io
import os
import subprocess as sp
import sys
import paddlespeech
from pathlib import Path
from setuptools import Command
......@@ -28,6 +27,8 @@ from setuptools.command.install import install
HERE = Path(os.path.abspath(os.path.dirname(__file__)))
PADDLESPEECH_VERSION = '0.1.1'
requirements = {
"install": [
"editdistance",
......@@ -83,6 +84,15 @@ requirements = {
}
def write_version_py(filename='paddlespeech/version.py'):
ver_str = """# THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY
#
full_version = '%(version)s'
"""
with open(filename, 'w') as f:
f.write(ver_str % {'version': PADDLESPEECH_VERSION})
@contextlib.contextmanager
def pushd(new_dir):
old_dir = os.getcwd()
......@@ -170,10 +180,12 @@ class UploadCommand(Command):
sys.exit()
write_version_py()
setup_info = dict(
# Metadata
name='paddlespeech',
version=paddlespeech.__version__,
version=PADDLESPEECH_VERSION,
author='PaddlePaddle Speech and Language Team',
author_email='paddlesl@baidu.com',
url='https://github.com/PaddlePaddle/PaddleSpeech',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册