hermes.commands.init.base
Attributes
Classes
Generic enumeration. |
|
Generic enumeration. |
|
Contains information about the current state of the target project directory. |
|
Configuration of the |
|
Install HERMES onto a project. |
Functions
|
This method looks at the current directory and collects all init relevant data. |
|
Returns the matching GitHoster value to the given url. Returns GitHoster.Empty if none is found. |
|
|
|
|
|
Returns a list of installed HermesPlugins based on a list of related command names. |
|
Own implementation of logging.getHandlerByName so that we don't require Python 3.12 |
Module Contents
- hermes.commands.init.base.TUTORIAL_URL = 'https://hermes.software-metadata.pub/en/latest/tutorials/automated-publication-with-ci.html'
- class hermes.commands.init.base.GitHoster
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- class hermes.commands.init.base.DepositPlatform
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- hermes.commands.init.base.DepositPlatformNames: dict[DepositPlatform, str]
- hermes.commands.init.base.DepositPlatformUrls: dict[DepositPlatform, str]
- class hermes.commands.init.base.HermesInitFolderInfo
Contains information about the current state of the target project directory.
- hermes.commands.init.base.scout_current_folder() HermesInitFolderInfo
This method looks at the current directory and collects all init relevant data. This method is not meant to contain any user interactions. @return: HermesInitFolderInfo object containing the gathered knowledge
- hermes.commands.init.base.get_git_hoster_from_url(url: str) GitHoster
Returns the matching GitHoster value to the given url. Returns GitHoster.Empty if none is found.
- hermes.commands.init.base.get_builtin_plugins(plugin_commands: list[str]) dict[str:HermesPlugin]
Returns a list of installed HermesPlugins based on a list of related command names. This is currently not used (we use the marketplace code instead) but maybe later.
- hermes.commands.init.base.get_handler_by_name(name: str) logging.Handler | None
Own implementation of logging.getHandlerByName so that we don’t require Python 3.12
- class hermes.commands.init.base._HermesInitSettings(/, **data: Any)
Bases:
pydantic.BaseModel
Configuration of the
init
command.
- class hermes.commands.init.base.HermesInitCommand(parser: argparse.ArgumentParser)
Bases:
hermes.commands.base.HermesCommand
Install HERMES onto a project.
- folder_info: HermesInitFolderInfo
- deposit_platform: DepositPlatform
- git_hoster: GitHoster
- selected_plugins: list[hermes.commands.marketplace.PluginInfo] = []
- init_command_parser(command_parser: argparse.ArgumentParser) None
Initialize the command line arguments available for this specific HERMES sub-commands.
You should override this method to add your custom arguments to the command line parser of the respective sub-command.
- Parameters:
command_parser – The command line sub-parser responsible for the HERMES sub-command.
- load_settings(args: argparse.Namespace)
Load settings from the configuration file (passed in from command line).
- refresh_folder_info() None
Checks the contents of the current directory and saves relevant info in self.folder_info
- __call__(args: argparse.Namespace) None
Execute the HERMES sub-command.
- Parameters:
args – The namespace that was returned by the command line parser when reading the arguments.
- create_citation_cff() None
If there is no CITATION.cff, the user gets the opportunity to create one online.
- create_ci_template() None
Downloads and configures the ci workflow files using templates from the chosen template branch.
- configure_ci_template(ci_file_path) None
Replaces all {%parameter%} in a ci file with values from ci_parameters dict
- integrate_deposit_platform() None
Makes changes to the toml data or something else based on the chosen deposit platform.
- choose_setup_method() None
User chooses his desired setup method: Either preferring automatic (if available) or manual.
- integrate_plugins() None
Plugin installation is added to the ci-parameters. Also for now we use this method to do custom plugin installation steps.
- no_git_setup(start_question: str = '') None
Makes the init for a gitless project (basically just creating hermes.toml)
- choose_push_branch() None
User chooses the branch that should be used to activate the whole hermes process.