diff --git a/percu/config/__init__.py b/percu/config/__init__.py index 3daeb63c00c6e80812823c70a17e733294a70009..28a7e562745a1e21756dc89c292c91e2f34fe709 100644 --- a/percu/config/__init__.py +++ b/percu/config/__init__.py @@ -160,7 +160,7 @@ class Config: # pylint: disable=too-few-public-methods @staticmethod def get() -> 'Config': - # TODO change this for a single Singleton ? + # TODO change this for a conventional Singleton ? global _CONFIG # pylint: disable=global-statement if _CONFIG is None: _CONFIG = Config._create() diff --git a/percu/config/defaults.py b/percu/config/defaults.py index 871a78d67956d8bb6d5472d8ec819e0bdb49bbdd..ce84b572ce2bdfebc08dbd31f28db24819f4882e 100644 --- a/percu/config/defaults.py +++ b/percu/config/defaults.py @@ -10,16 +10,16 @@ import yaml from ..utils import prompt_user, print_info, print_warning -def create_default_project(path: str): +def create_default_project(): """ Generate the des TODO """ dot_percu: str = '.percu/' - configs_file = join(dot_percu, 'configs.yaml') + config_file = join(dot_percu, 'configs.yaml') config: dict[str, Any] = {} - if not isfile(configs_file): - print_info("Generating configurations") + if not isfile(config_file): + print_info("Generating configuration file") cwd: str = basename(getcwd()) config['project_name'] = input(f"Project name [{cwd}]: ").strip() or cwd config['username'] = input("Inria username: ").strip() @@ -96,20 +96,20 @@ def create_default_project(path: str): mkdir(dot_percu) # Then, dump the config to the config file if it doesn't already exists - if not isfile(configs_file): - with open(configs_file, 'w') as file_stream: + if not isfile(config_file): + with open(config_file, 'w') as file_stream: yaml.dump(data=config, stream=file_stream, default_flow_style=False, sort_keys=False) else: - print_info(f'Config file (`{configs_file}`) already exists: skipping.') + print_info(f'Config file (`{config_file}`) already exists: skipping.') exclude_file = join(dot_percu, 'exclude.txt') with open(join(dot_percu, '.gitignore'), 'a') as gitignore: gitignore.write('*') - gitignore.write(configs_file) + gitignore.write(config_file) gitignore.write(exclude_file) if not isfile(exclude_file): diff --git a/percu/core.py b/percu/core.py index b73a7ecd456f52d6e2ca5fc79a37d9cc1cb39a99..6cb9a3b330ce530b7e4162343080e282fe342f2d 100644 --- a/percu/core.py +++ b/percu/core.py @@ -158,16 +158,16 @@ def clean(directory: str, def init() -> None: """ - Create the default project. Generate the configuration files. + Initialize the project in the current working directory. Generate the configuration files. """ print_info(text='Creating a brand new percu project.', bold=True) - create_default_project(path='.') + create_default_project() def setup(hostname: str) -> None: """ - Sync the project, update packages. + Set up remote project location and install virtual environment if any. Args: hostname (str): The hostname of the remote computer. diff --git a/percu/remote.py b/percu/remote.py index f3be09a4ccfc6571a1ed23ddecf217851a105238..0d43ef7e62163dfdf9ee74af2cd6c23b6bdc2097 100644 --- a/percu/remote.py +++ b/percu/remote.py @@ -53,9 +53,8 @@ def remote(sub_command: str, if container_path != '': cmd.append(container_path) - cmd += ['--nv'] - - cmd += [config.singularity.output_sif_name] + # Enable GPU support and provide the path to the container image + cmd += ['--nv', config.singularity.output_sif_name] # Enable virtual environment if any. elif config.virtual_env is not None and config.virtual_env.enabled: diff --git a/pylintrc b/pylintrc index 87c4fadc898d6eaaa1d1b5d9e72270f3e2904d69..8849d8bc5eacdc36ffa3ba8fd06c28cd7851f652 100644 --- a/pylintrc +++ b/pylintrc @@ -140,7 +140,8 @@ disable=print-statement, exception-escape, comprehension-escape, missing-function-docstring, - too-many-branches + too-many-branches, + too-many-statements # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option