加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
nauyll 提交于 2023-04-24 10:54 . 【5.0.RC2】代码目录重构
# coding: UTF-8
# Copyright (c) 2022. Huawei Technologies Co., Ltd. ALL rights reserved.
import shutil
from pathlib import Path
from setuptools import setup, find_packages
from ascend_fd.utils.tool import safe_open, VERSION_FILE_READ_LIMIT
DEFAULT_VERSION = "5.0.RC2"
def get_version():
src_path = Path(__file__).absolute().parent
verison_file = src_path.joinpath('ascend_fd', 'Version.info')
if not verison_file.exists():
return DEFAULT_VERSION
with safe_open(verison_file, 'r') as f:
return f.read(VERSION_FILE_READ_LIMIT)
def clean():
cache_folder = ('ascend_fd.egg-info', "build*")
for pattern in cache_folder:
for folder in Path().glob(pattern):
if folder.exists():
shutil.rmtree(folder)
clean()
setup(
name='ascend-fd',
version=get_version(),
description='ascend fault diag',
packages=find_packages(),
include_package_data=True,
python_requires='>=3.6',
entry_points={
'console_scripts': [
'ascend-fd=ascend_fd.cli.cli:main'
]
}
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化