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 d18d146d79.

* 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:
2024-11-01 16:07:04 +02:00
committed by GitHub
parent 6fe77eb465
commit 93ce7f9a51
105 changed files with 1982 additions and 1631 deletions

View File

@ -4,7 +4,7 @@ import pytest
from pathlib import Path
from pytest_mock import MockerFixture
from ahriman.application.handlers import Handler
from ahriman.application.handlers.handler import Handler
from ahriman.core.configuration import Configuration
from ahriman.core.exceptions import ExitCode, MissingArchitectureError, MultipleArchitecturesError
from ahriman.models.log_handler import LogHandler
@ -19,7 +19,7 @@ def test_call(args: argparse.Namespace, configuration: Configuration, mocker: Mo
args.log_handler = LogHandler.Console
args.quiet = False
args.report = False
mocker.patch("ahriman.application.handlers.Handler.run")
mocker.patch("ahriman.application.handlers.handler.Handler.run")
configuration_mock = mocker.patch("ahriman.core.configuration.Configuration.from_path", return_value=configuration)
log_handler_mock = mocker.patch("ahriman.core.log.log_loader.LogLoader.handler", return_value=args.log_handler)
log_load_mock = mocker.patch("ahriman.core.log.log_loader.LogLoader.load")
@ -76,7 +76,7 @@ def test_execute(args: argparse.Namespace, mocker: MockerFixture) -> None:
RepositoryId("i686", "aur"),
RepositoryId("x86_64", "aur"),
]
mocker.patch("ahriman.application.handlers.Handler.repositories_extract", return_value=ids)
mocker.patch("ahriman.application.handlers.handler.Handler.repositories_extract", return_value=ids)
starmap_mock = mocker.patch("multiprocessing.pool.Pool.starmap")
Handler.execute(args)
@ -88,7 +88,7 @@ def test_execute_multiple_not_supported(args: argparse.Namespace, mocker: Mocker
must raise an exception if multiple architectures are not supported by the handler
"""
args.command = "web"
mocker.patch("ahriman.application.handlers.Handler.repositories_extract", return_value=[
mocker.patch("ahriman.application.handlers.handler.Handler.repositories_extract", return_value=[
RepositoryId("i686", "aur"),
RepositoryId("x86_64", "aur"),
])
@ -102,7 +102,7 @@ def test_execute_single(args: argparse.Namespace, mocker: MockerFixture) -> None
"""
must run execution in current process if only one architecture supplied
"""
mocker.patch("ahriman.application.handlers.Handler.repositories_extract", return_value=[
mocker.patch("ahriman.application.handlers.handler.Handler.repositories_extract", return_value=[
RepositoryId("x86_64", "aur"),
])
starmap_mock = mocker.patch("multiprocessing.pool.Pool.starmap")