代码拉取完成,页面将自动刷新
同步操作将从 Ascend/ascend-deployer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
# ===========================================================================
"""setup package."""
import os
import glob
import stat
import shutil
import setuptools
cache_folder = ('*egg-info', 'build')
def clean():
for pattern in cache_folder:
for name in glob.glob(pattern):
if os.path.exists(name):
shutil.rmtree(name)
def crlf_to_lf(file_path):
with os.fdopen(os.open(file_path, os.O_RDONLY, 0o640), 'r', encoding='utf-8') as src:
content = src.read()
os.chmod(file_path, stat.S_IWRITE)
with open(file_path, 'w', newline='\n', encoding='utf-8') as dst:
dst.write(content.replace('\r\n', '\n'))
def handle_shell_scripts():
cur_dir = os.path.abspath(os.path.dirname(__file__))
for base, dirs, files in os.walk(os.path.join(cur_dir, 'ascend_deployer')):
for file_name in files:
file_path = os.path.join(base, file_name)
if not file_path.endswith('.sh'):
continue
crlf_to_lf(file_path)
os.umask(stat.S_IRWXG | stat.S_IRWXO)
os.chmod('ascend_deployer/install.sh', stat.S_IEXEC | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP)
os.chmod('ascend_deployer/start_download.sh', stat.S_IEXEC | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP)
clean()
handle_shell_scripts()
with open('README.rst', encoding='utf-8') as f:
readme = f.read()
setuptools.setup(
name='ascend-deployer',
version='0.0.3',
description='ascend offline installer',
url='https://gitee.com/ascend/ascend-deployer',
long_description_content_type="text/x-rst",
long_description=readme,
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent'
],
license='Apache',
python_requires='>= 3.6',
include_package_data=True,
package_dir={'downloader': 'ascend_deployer/downloader', 'playbooks': 'ascend_deployer/playbooks'},
packages=['ascend_deployer'],
entry_points={ # Optional
'console_scripts': [
'ascend-download=ascend_deployer.ascend_download:main',
'ascend-deployer=ascend_deployer.ascend_deployer:main'
]
},
)
clean()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。