Compare commits

...
5 Commits
Author SHA1 Message Date
arcanis 11965d78d3 remove crap from local pyprojects 2026-07-17 10:03:02 +03:00
arcanis 6664a2e656 remove empty conftest 2026-07-17 09:09:10 +03:00
arcanis 6c0fdcda6e simplify configuration fixture 2026-07-17 09:05:32 +03:00
arcanis a8888aa106 disable pylint warning 2026-07-17 08:58:48 +03:00
arcanis 5d4502aaed remove duplicate fixtures 2026-07-17 08:54:32 +03:00
9 changed files with 13 additions and 118 deletions
+2 -12
View File
@@ -6,13 +6,6 @@ build-backend = "hatchling.build"
[project]
name = "ahriman-core"
description = "ArcH linux ReposItory MANager, core package"
readme = "../README.md"
requires-python = ">=3.13"
license = { file = "../COPYING" }
authors = [
{ name = "ahriman team" },
]
dependencies = [
"bcrypt",
"filelock",
@@ -20,9 +13,11 @@ dependencies = [
"pyelftools",
"requests",
]
description = "ArcH linux ReposItory MANager, core package"
dynamic = [
"version",
]
requires-python = ">=3.13"
[project.optional-dependencies]
journald = [
@@ -56,11 +51,6 @@ validator = [
[project.scripts]
ahriman = "ahriman.application.ahriman:run"
[project.urls]
Documentation = "https://ahriman.readthedocs.io/"
Repository = "https://github.com/arcan1s/ahriman"
Changelog = "https://github.com/arcan1s/ahriman/releases"
[tool.hatch.build.targets.wheel]
packages = [
"src/ahriman",
@@ -3,7 +3,6 @@ import pytest
from pytest_mock import MockerFixture
from ahriman.application.ahriman import _parser
from ahriman.application.application import Application
from ahriman.application.help_formatter import _HelpFormatter
from ahriman.application.lock import Lock
@@ -33,18 +32,6 @@ def application(configuration: Configuration, repository: Repository, database:
return Application(repository_id, configuration, report=False)
@pytest.fixture
def args() -> argparse.Namespace:
"""
fixture for command line arguments
Returns:
argparse.Namespace: command line arguments test instance
"""
return argparse.Namespace(architecture=None, lock=None, force=False, unsafe=False, report=False,
repository=None, repository_id=None, wait_timeout=-1)
@pytest.fixture
def formatter() -> _HelpFormatter:
"""
@@ -70,14 +57,3 @@ def lock(args: argparse.Namespace, configuration: Configuration) -> Lock:
"""
_, repository_id = configuration.check_loaded()
return Lock(args, repository_id, configuration)
@pytest.fixture
def parser() -> argparse.ArgumentParser:
"""
fixture for command line arguments parser
Returns:
argparse.ArgumentParser: command line arguments parser test instance
"""
return _parser()
@@ -4,7 +4,6 @@ import pytest
from ahriman.core.alpm.repo import Repo
from ahriman.core.build_tools.task import Task
from ahriman.core.configuration import Configuration
from ahriman.core.sign.gpg import GPG
from ahriman.core.tree import Leaf
from ahriman.models.package import Package
from ahriman.models.repository_paths import RepositoryPaths
@@ -64,20 +63,6 @@ def repo(configuration: Configuration, repository_paths: RepositoryPaths) -> Rep
return Repo(configuration.get("repository", "name"), repository_paths, [])
@pytest.fixture
def gpg(configuration: Configuration) -> GPG:
"""
fixture for empty GPG
Args:
configuration(Configuration): configuration fixture
Returns:
GPG: GPG test instance
"""
return GPG(configuration)
@pytest.fixture
def task_ahriman(package_ahriman: Package, configuration: Configuration, repository_paths: RepositoryPaths) -> Task:
"""
+2 -12
View File
@@ -6,24 +6,14 @@ build-backend = "hatchling.build"
[project]
name = "ahriman-triggers"
description = "ArcH linux ReposItory MANager, additional extensions"
readme = "../README.md"
requires-python = ">=3.13"
license = { file = "../COPYING" }
authors = [
{ name = "ahriman team" },
]
dependencies = [
"ahriman-core",
]
description = "ArcH linux ReposItory MANager, additional extensions"
dynamic = [
"version",
]
[project.urls]
Documentation = "https://ahriman.readthedocs.io/"
Repository = "https://github.com/arcan1s/ahriman"
Changelog = "https://github.com/arcan1s/ahriman/releases"
requires-python = ">=3.13"
[tool.hatch.build.targets.wheel]
packages = [
+2 -12
View File
@@ -6,13 +6,6 @@ build-backend = "hatchling.build"
[project]
name = "ahriman-web"
description = "ArcH linux ReposItory MANager, web server"
readme = "../README.md"
requires-python = ">=3.13"
license = { file = "../COPYING" }
authors = [
{ name = "ahriman team" },
]
dependencies = [
"ahriman-core",
"aiohttp",
@@ -20,9 +13,11 @@ dependencies = [
"aiohttp_jinja2",
"aiohttp_sse",
]
description = "ArcH linux ReposItory MANager, web server"
dynamic = [
"version",
]
requires-python = ">=3.13"
[project.optional-dependencies]
auth = [
@@ -42,11 +37,6 @@ oauth2 = [
"aioauth-client",
]
[project.urls]
Documentation = "https://ahriman.readthedocs.io/"
Repository = "https://github.com/arcan1s/ahriman"
Changelog = "https://github.com/arcan1s/ahriman/releases"
[tool.hatch.build.targets.wheel]
packages = [
"src/ahriman",
+5 -5
View File
@@ -6,10 +6,6 @@ build-backend = "hatchling.build"
[project]
name = "ahriman"
description = "ArcH linux ReposItory MANager"
readme = "README.md"
requires-python = ">=3.13"
license = { file = "COPYING" }
authors = [
{ name = "ahriman team" },
]
@@ -18,14 +14,18 @@ dependencies = [
"ahriman-triggers",
"ahriman-web",
]
description = "ArcH linux ReposItory MANager"
dynamic = [
"version",
]
license = { file = "COPYING" }
readme = "README.md"
requires-python = ">=3.13"
[project.urls]
Changelog = "https://github.com/arcan1s/ahriman/releases"
Documentation = "https://ahriman.readthedocs.io/"
Repository = "https://github.com/arcan1s/ahriman"
Changelog = "https://github.com/arcan1s/ahriman/releases"
[dependency-groups]
check = [
@@ -132,6 +132,7 @@ def import_error(package: str, components: list[str], mocker: MockerFixture) ->
import builtins
_import = builtins.__import__
# pylint: disable=redefined-builtin
def test_import(name: str, globals: Any, locals: Any, from_list: list[str], level: Any):
if name == package and (not components or any(component in from_list for component in components)):
raise ImportError
@@ -254,43 +255,6 @@ def configuration(repository_id: RepositoryId, tmp_path: Path, resource_path_roo
path = resource_path_root / "core" / "ahriman.ini"
instance = Configuration.from_path(path, repository_id)
settings_root = resource_path_root.parent.parent / "ahriman-core" / "package" / "share" / "ahriman" / "settings"
logging_path = settings_root / "ahriman.ini.d" / "logging.ini"
instance.set_option("settings", "include", str(settings_root / "ahriman.ini.d"))
instance.set_option("settings", "logging", str(logging_path))
for include_root in (
settings_root /
"ahriman.ini.d",
resource_path_root.parent.parent /
"ahriman-triggers" /
"package" /
"share" /
"ahriman" /
"settings" /
"ahriman.ini.d",
resource_path_root.parent.parent /
"ahriman-web" /
"package" /
"share" /
"ahriman" /
"settings" /
"ahriman.ini.d",
):
for include in sorted(include_root.glob("*.ini")):
if include != logging_path:
instance.read(include)
core_templates = resource_path_root.parent.parent / "ahriman-core" / "package" / "share" / "ahriman" / "templates"
web_templates = resource_path_root.parent.parent / "ahriman-web" / "package" / "share" / "ahriman" / "templates"
for section in ("email", "html", "rss", "telegram"):
instance.set_option(section, "templates", str(core_templates))
instance.set_option("keyring", "target", "keyring")
instance.set_option("mirrorlist", "target", "mirrorlist")
instance.set_option("web", "templates", str(web_templates))
instance.set_option("web", "static_path", str(web_templates / "static"))
instance.set_option("web", "autorefresh_intervals", "")
instance.set_option("repository", "root", str(tmp_path))
instance.set_option("settings", "database", str(tmp_path / "ahriman.db"))
+1 -1
View File
@@ -6,10 +6,10 @@ build-backend = "hatchling.build"
[project]
name = "ahriman-pytest-plugins"
version = "1"
classifiers = [
"Framework :: Pytest",
]
version = "1"
[project.entry-points.pytest11]
ahriman-fixtures = "ahriman_fixtures"