From 98a150fce0bb4bacdfcd2a6ebd773add3709edb8 Mon Sep 17 00:00:00 2001 From: jiangjiajun Date: Tue, 6 Aug 2019 15:10:20 +0800 Subject: [PATCH] modify setup.py --- README.md | 2 +- setup.py | 11 +++++++++-- x2paddle/__init__.py | 1 + x2paddle/convert.py | 13 ++++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 09dd30f..1574145 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ paddlepaddle >= 1.5.0 ## 安装 ``` -pip install git+https://github.com/PaddlePaddle/X2Paddle.git@develop +pip install x2paddle --index-url=https://pypi.org/simple/ ``` ## 使用方法 diff --git a/setup.py b/setup.py index e3171b3..3470161 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,20 @@ import setuptools +import x2paddle + +long_description = "X2Paddle is a toolkit for converting trained model to PaddlePaddle from other deep learning frameworks.\n\n" +long_description += "Usage: x2paddle --framework tensorflow --model tf_model.pb --save_dir paddle_model\n" +long_description += "GitHub: https://github.com/PaddlePaddle/X2Paddle\n" +long_description += "Email: dltp-sz@baidu.com" setuptools.setup( name="x2paddle", - version="0.4.0", + version=x2paddle.__version__, author="dltp-sz", author_email="dltp-sz@baidu.com", description= "a toolkit for converting trained model to PaddlePaddle from other deep learning frameworks.", - long_description_content_type="text/markdown", + long_description=long_description, + long_description_content_type="text/plain", url="https://github.com/PaddlePaddle/x2paddle", packages=setuptools.find_packages(), classifiers=[ diff --git a/x2paddle/__init__.py b/x2paddle/__init__.py index e69de29..3d26edf 100644 --- a/x2paddle/__init__.py +++ b/x2paddle/__init__.py @@ -0,0 +1 @@ +__version__ = "0.4.1" diff --git a/x2paddle/convert.py b/x2paddle/convert.py index c604638..c68fb62 100644 --- a/x2paddle/convert.py +++ b/x2paddle/convert.py @@ -15,6 +15,7 @@ from six import text_type as _text_type import argparse import sys +import x2paddle def arg_parser(): @@ -49,6 +50,12 @@ def arg_parser(): type=_text_type, default=None, help="caffe proto file of caffe model") + parser.add_argument("--version", + "-v", + action="store_true", + default=False, + help="get version of x2paddle") + return parser @@ -112,12 +119,16 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto): def main(): if len(sys.argv) < 2: - print("Use \"x2paddle -h\" to print the help information") + print("Use \"x2paddle -h\" to print the help information\n") return parser = arg_parser() args = parser.parse_args() + if args.version: + print("x2paddle-{} with python>=3.5\n".format(x2paddle.__version__)) + return + try: import paddle v0, v1, v2 = paddle.__version__.split('.') -- GitLab