combine py config files

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2020-09-14 16:57:44 +08:00
parent 38c2f6b3a3
commit 43bb7a5b63
3 changed files with 18 additions and 19 deletions

View File

@ -20,7 +20,7 @@ from abc import abstractmethod, ABCMeta
from packaging import version
from . import log as logger
from .version import __version__
from .package_name import __package_name__
from .default_config import __package_name__
class EnvChecker(metaclass=ABCMeta):

View File

@ -27,8 +27,7 @@ from mindspore._checkparam import args_type_check
from mindspore.parallel._auto_parallel_context import _set_auto_parallel_context, _get_auto_parallel_context, \
_reset_auto_parallel_context
from mindspore.parallel._ps_context import _set_ps_context, _get_ps_context, _reset_ps_context
from .device_target import __device_target__
from .package_name import __package_name__
from .default_config import __device_target__, __package_name__
__all__ = ['GRAPH_MODE', 'PYNATIVE_MODE', 'set_context', 'get_context', 'set_auto_parallel_context',
'get_auto_parallel_context', 'reset_auto_parallel_context', 'ParallelMode', 'set_ps_context',

View File

@ -65,22 +65,6 @@ def _write_device_target(file):
def build_dependencies():
"""generate python file"""
target = os.path.join(pkg_dir, 'mindspore', 'device_target.py')
with open(target, 'w') as f:
_write_device_target(f)
target = os.path.join(pwd, 'mindspore', 'device_target.py')
with open(target, 'w') as f:
_write_device_target(f)
package_info = os.path.join(pkg_dir, 'mindspore', 'package_name.py')
with open(package_info, 'w') as f:
_write_package_name(f)
package_info = os.path.join(pwd, 'mindspore', 'package_name.py')
with open(package_info, 'w') as f:
_write_package_name(f)
version_file = os.path.join(pkg_dir, 'mindspore', 'version.py')
with open(version_file, 'w') as f:
_write_version(f)
@ -97,6 +81,22 @@ def build_dependencies():
with open(config_file, 'w') as f:
_write_config(f)
target = os.path.join(pkg_dir, 'mindspore', 'default_config.py')
with open(target, 'a') as f:
_write_device_target(f)
target = os.path.join(pwd, 'mindspore', 'default_config.py')
with open(target, 'a') as f:
_write_device_target(f)
package_info = os.path.join(pkg_dir, 'mindspore', 'default_config.py')
with open(package_info, 'a') as f:
_write_package_name(f)
package_info = os.path.join(pwd, 'mindspore', 'default_config.py')
with open(package_info, 'a') as f:
_write_package_name(f)
commit_file = os.path.join(pkg_dir, 'mindspore', '.commit_id')
with open(commit_file, 'w') as f:
_write_commit_file(f)