:py:mod:`mloq.commands` ======================= .. py:module:: mloq.commands .. autoapi-nested-parse:: Contains all the defined mloq Commands. Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 ci/index.rst docker/index.rst docs/index.rst globals/index.rst license/index.rst lint/index.rst package/index.rst project/index.rst requirements/index.rst setup/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: mloq.commands.CiCMD mloq.commands.DockerCMD mloq.commands.DocsCMD mloq.commands.GlobalsCMD mloq.commands.LicenseCMD mloq.commands.LintCMD mloq.commands.PackageCMD mloq.commands.ProjectCMD mloq.commands.RequirementsCMD mloq.commands.SetupCMD .. py:class:: CiCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the ci Command. .. py:attribute:: cmd_name :annotation: :str = ci .. py:attribute:: ubuntu_version .. py:attribute:: disable .. py:attribute:: docker .. py:attribute:: project_name .. py:attribute:: default_branch .. py:attribute:: docker_org .. py:attribute:: bot_name .. py:attribute:: bot_email .. py:attribute:: ci_python_version .. py:attribute:: python_versions .. py:attribute:: ci_extra .. py:attribute:: vendor .. py:attribute:: open_source .. py:attribute:: author .. py:attribute:: owner .. py:attribute:: email .. py:attribute:: project_url .. py:attribute:: files .. py:method:: directories() :property: Tuple containing Paths objects representing the directories created by the command. .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: DockerCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the docker Command. .. py:attribute:: cmd_name :annotation: = docker .. py:attribute:: files .. py:attribute:: disable .. py:attribute:: cuda .. py:attribute:: cuda_image_type .. py:attribute:: cuda_version .. py:attribute:: ubuntu_version .. py:attribute:: project_name .. py:attribute:: docker_org .. py:attribute:: python_version .. py:attribute:: base_image .. py:attribute:: test .. py:attribute:: lint .. py:attribute:: jupyter .. py:attribute:: jupyter_password .. py:attribute:: requirements .. py:attribute:: extra .. py:attribute:: makefile .. py:method:: require_cuda_from_requirements(project_config = None) :staticmethod: Return True if any of the project dependencies require CUDA. .. py:method:: requires_cuda() Return True if the Docker container requires CUDA. .. py:method:: get_base_image() Return the name of the base image for the project Docker container. .. py:method:: parse_config() Update the configuration dictionary from the data entered by the user. .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: DocsCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the docs Command. .. py:attribute:: cmd_name :annotation: = docs .. py:attribute:: disable .. py:attribute:: project_name .. py:attribute:: description .. py:attribute:: author .. py:attribute:: copyright_year .. py:attribute:: copyright_holder .. py:attribute:: deploy_docs .. py:attribute:: default_branch .. py:attribute:: project_url .. py:attribute:: files .. py:method:: directories() :property: Tuple containing Paths objects representing the directories created by the command. .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: GlobalsCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the globals Command. .. py:attribute:: cmd_name :annotation: = globals .. py:attribute:: project_name .. py:attribute:: description .. py:attribute:: author .. py:attribute:: owner .. py:attribute:: email .. py:attribute:: open_source .. py:attribute:: project_url .. py:attribute:: default_branch .. py:attribute:: license .. py:attribute:: use_poetry .. py:attribute:: main_python_version .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: parse_config() Generate the configuration of the project via a configuration file. .. py:class:: LicenseCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the license Command. .. py:attribute:: cmd_name :annotation: = license .. py:attribute:: files .. py:attribute:: LICENSES .. py:attribute:: disable .. py:attribute:: license .. py:attribute:: copyright_year .. py:attribute:: copyright_holder .. py:attribute:: project_name .. py:attribute:: project_url .. py:attribute:: email .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: LintCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the lint Command. .. py:attribute:: cmd_name :annotation: = lint .. py:attribute:: files .. py:attribute:: disable .. py:attribute:: black .. py:attribute:: isort .. py:attribute:: linters .. py:attribute:: docstring_checks .. py:attribute:: pyproject_extra .. py:attribute:: project_name .. py:attribute:: makefile .. py:attribute:: poetry_requirements .. py:attribute:: ignore_files .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: PackageCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the package Command. .. py:attribute:: cmd_name :annotation: = package .. py:attribute:: files .. py:attribute:: LICENSE_CLASSIFIERS .. py:attribute:: disable .. py:attribute:: pyproject_extra .. py:attribute:: project_name .. py:attribute:: license .. py:attribute:: license_classifier .. py:attribute:: description .. py:attribute:: default_branch .. py:attribute:: project_url .. py:attribute:: owner .. py:attribute:: author .. py:attribute:: email .. py:attribute:: main_python_version .. py:attribute:: python_versions .. py:attribute:: use_poetry .. py:method:: parse_config() Update the configuration DictConfig with the Command parameters. .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: ProjectCMD(record, interactive = False, **kwargs) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the project Command. .. py:attribute:: cmd_name :annotation: = project .. py:attribute:: files .. py:attribute:: disable .. py:attribute:: project_name .. py:attribute:: owner .. py:attribute:: description .. py:attribute:: project_url .. py:attribute:: license .. py:attribute:: tests .. py:method:: directories() :property: Tuple containing Paths objects representing the directories created by the command. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: RequirementsCMD(record, interactive = False) Bases: :py:obj:`mloq.command.Command` Implement the functionality of the requirements Command. .. py:attribute:: cmd_name :annotation: = requirements .. py:attribute:: files .. py:attribute:: disable .. py:attribute:: requirements .. py:attribute:: REQUIREMENTS_ALIASES .. py:method:: __del__() Remove the temporary directory when the instance is deleted. .. py:method:: get_aliased_requirements_file(option) :classmethod: Get requirement file from aliased name. .. py:method:: read_requirements_file(option) :classmethod: Return the content of the target requirements file form an aliased name. .. py:method:: compose_requirements(options) :classmethod: Return the content requirements.txt file with pinned dependencies. The returned string contains the combined dependencies for the different options sorted alphabetically. :param options: Iterable containing the aliased names of the target dependencies for the project. :returns: str containing the pinned versions of all the selected requirements. .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: requirements_is_empty(options) :staticmethod: Return True if no requirements are specified for the project. .. py:method:: record_files() Register the files that will be generated by mloq. .. py:class:: SetupCMD(record, interactive = False) Bases: :py:obj:`mloq.command.CommandMixin` Implement the functionality of the setup Command. .. py:attribute:: cmd_name :annotation: = setup .. py:attribute:: files .. py:attribute:: SUB_COMMAND_CLASSES .. py:method:: config() :property: List of all the commands that will be executed when running mloq setup. .. py:method:: sub_commands() :property: List of all the commands that will be executed when running mloq setup. .. py:method:: directories() :property: Tuple containing Paths objects representing the directories created by the command. .. py:method:: interactive_config() Generate the configuration of the project interactively. .. py:method:: parse_config() Update the configuration DictConfig with the Command parameters. .. py:method:: run_side_effects() Apply additional configuration methods. .. py:method:: record_files() Register the files that will be generated by mloq.