mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-08 11:13:39 +00:00
feat: use split packages (#135)
* move argument parsers to handlers themselves * use hatchling instead of flit * Revert "use hatchling instead of flit" This reverts commit d18d146d796bef01f7bba9003bc634946649f9aa. * add package-splitt script * replace simplify walk method * split packages * explicitly install packages * separate support triggers from main package * add docs examples * sort actions * docs update * add metapackage * review fixes
This commit is contained in:
@@ -22,7 +22,7 @@ import copy
|
||||
|
||||
from typing import Any
|
||||
|
||||
from ahriman.application.handlers.handler import Handler
|
||||
from ahriman.application.handlers.handler import Handler, SubParserAction
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.configuration.schema import CONFIGURATION_SCHEMA, ConfigurationSchema
|
||||
from ahriman.core.exceptions import ExtensionError
|
||||
@@ -63,6 +63,25 @@ class Validate(Handler):
|
||||
# as we reach this part it means that we always have errors
|
||||
Validate.check_status(args.exit_code, False)
|
||||
|
||||
@staticmethod
|
||||
def _set_service_config_validate_parser(root: SubParserAction) -> argparse.ArgumentParser:
|
||||
"""
|
||||
add parser for config validation subcommand
|
||||
|
||||
Args:
|
||||
root(SubParserAction): subparsers for the commands
|
||||
|
||||
Returns:
|
||||
argparse.ArgumentParser: created argument parser
|
||||
"""
|
||||
parser = root.add_parser("service-config-validate", aliases=["config-validate", "repo-config-validate"],
|
||||
help="validate system configuration",
|
||||
description="validate configuration and print found errors")
|
||||
parser.add_argument("-e", "--exit-code", help="return non-zero exit status if configuration is invalid",
|
||||
action="store_true")
|
||||
parser.set_defaults(lock=None, quiet=True, report=False, unsafe=True)
|
||||
return parser
|
||||
|
||||
@staticmethod
|
||||
def schema(repository_id: RepositoryId, configuration: Configuration) -> ConfigurationSchema:
|
||||
"""
|
||||
@@ -136,3 +155,5 @@ class Validate(Handler):
|
||||
Validate.schema_merge(value, schema[key])
|
||||
|
||||
return schema
|
||||
|
||||
arguments = [_set_service_config_validate_parser]
|
||||
|
||||
Reference in New Issue
Block a user