提交 9d54734c 编写于 作者: T tangwei

windows supported

上级 5ef4a80c
...@@ -34,27 +34,28 @@ about["__url__"] = "https://github.com/PaddlePaddle/PaddleRec" ...@@ -34,27 +34,28 @@ about["__url__"] = "https://github.com/PaddlePaddle/PaddleRec"
readme = "" readme = ""
def run_cmd(command):
assert command is not None and isinstance(command, str)
return os.popen(command).read().strip()
def build(dirname): def build(dirname):
package_dir = os.path.dirname(os.path.abspath(__file__)) package_dir = os.path.dirname(os.path.abspath(__file__))
run_cmd("cp -r {}/* {}".format(package_dir, dirname)) shutil.copytree(
run_cmd("mkdir {}".format(os.path.join(dirname, "paddlerec"))) package_dir, dirname, ignore=shutil.ignore_patterns(".git"))
run_cmd("mv {} {}".format( os.mkdir(os.path.join(dirname, "paddlerec"))
os.path.join(dirname, "core"), os.path.join(dirname, "paddlerec"))) shutil.move(
run_cmd("mv {} {}".format( os.path.join(dirname, "core"), os.path.join(dirname, "paddlerec"))
os.path.join(dirname, "doc"), os.path.join(dirname, "paddlerec"))) shutil.move(
run_cmd("mv {} {}".format( os.path.join(dirname, "doc"), os.path.join(dirname, "paddlerec"))
os.path.join(dirname, "models"), os.path.join(dirname, "paddlerec"))) shutil.move(
run_cmd("mv {} {}".format( os.path.join(dirname, "models"), os.path.join(dirname, "paddlerec"))
os.path.join(dirname, "tests"), os.path.join(dirname, "paddlerec"))) shutil.move(
run_cmd("mv {} {}".format( os.path.join(dirname, "tests"), os.path.join(dirname, "paddlerec"))
os.path.join(dirname, "tools"), os.path.join(dirname, "paddlerec"))) shutil.move(
run_cmd("mv {} {}".format( os.path.join(dirname, "tools"), os.path.join(dirname, "paddlerec"))
os.path.join(dirname, "*.py"), os.path.join(dirname, "paddlerec")))
for f in os.listdir(dirname):
if os.path.isdir(f):
continue
if os.path.splitext(f)[1] == ".py":
shutil.move(
os.path.join(dirname, f), os.path.join(dirname, "paddlerec"))
packages = find_packages(dirname, include=('paddlerec.*')) packages = find_packages(dirname, include=('paddlerec.*'))
package_dir = {'': dirname} package_dir = {'': dirname}
...@@ -90,7 +91,7 @@ def build(dirname): ...@@ -90,7 +91,7 @@ def build(dirname):
zip_safe=False) zip_safe=False)
dirname = tempfile.mkdtemp() dirname = tempfile.mktemp()
build(dirname) build(dirname)
shutil.rmtree(dirname) shutil.rmtree(dirname)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册