mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-08-20 15:27:26 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11965d78d3 | ||
|
|
6664a2e656 | ||
|
|
6c0fdcda6e | ||
|
|
a8888aa106 | ||
|
|
5d4502aaed |
@@ -6,13 +6,6 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "ahriman-core"
|
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 = [
|
dependencies = [
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
"filelock",
|
"filelock",
|
||||||
@@ -20,9 +13,11 @@ dependencies = [
|
|||||||
"pyelftools",
|
"pyelftools",
|
||||||
"requests",
|
"requests",
|
||||||
]
|
]
|
||||||
|
description = "ArcH linux ReposItory MANager, core package"
|
||||||
dynamic = [
|
dynamic = [
|
||||||
"version",
|
"version",
|
||||||
]
|
]
|
||||||
|
requires-python = ">=3.13"
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
journald = [
|
journald = [
|
||||||
@@ -56,11 +51,6 @@ validator = [
|
|||||||
[project.scripts]
|
[project.scripts]
|
||||||
ahriman = "ahriman.application.ahriman:run"
|
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]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = [
|
packages = [
|
||||||
"src/ahriman",
|
"src/ahriman",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import pytest
|
|||||||
|
|
||||||
from pytest_mock import MockerFixture
|
from pytest_mock import MockerFixture
|
||||||
|
|
||||||
from ahriman.application.ahriman import _parser
|
|
||||||
from ahriman.application.application import Application
|
from ahriman.application.application import Application
|
||||||
from ahriman.application.help_formatter import _HelpFormatter
|
from ahriman.application.help_formatter import _HelpFormatter
|
||||||
from ahriman.application.lock import Lock
|
from ahriman.application.lock import Lock
|
||||||
@@ -33,18 +32,6 @@ def application(configuration: Configuration, repository: Repository, database:
|
|||||||
return Application(repository_id, configuration, report=False)
|
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
|
@pytest.fixture
|
||||||
def formatter() -> _HelpFormatter:
|
def formatter() -> _HelpFormatter:
|
||||||
"""
|
"""
|
||||||
@@ -70,14 +57,3 @@ def lock(args: argparse.Namespace, configuration: Configuration) -> Lock:
|
|||||||
"""
|
"""
|
||||||
_, repository_id = configuration.check_loaded()
|
_, repository_id = configuration.check_loaded()
|
||||||
return Lock(args, repository_id, configuration)
|
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.alpm.repo import Repo
|
||||||
from ahriman.core.build_tools.task import Task
|
from ahriman.core.build_tools.task import Task
|
||||||
from ahriman.core.configuration import Configuration
|
from ahriman.core.configuration import Configuration
|
||||||
from ahriman.core.sign.gpg import GPG
|
|
||||||
from ahriman.core.tree import Leaf
|
from ahriman.core.tree import Leaf
|
||||||
from ahriman.models.package import Package
|
from ahriman.models.package import Package
|
||||||
from ahriman.models.repository_paths import RepositoryPaths
|
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, [])
|
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
|
@pytest.fixture
|
||||||
def task_ahriman(package_ahriman: Package, configuration: Configuration, repository_paths: RepositoryPaths) -> Task:
|
def task_ahriman(package_ahriman: Package, configuration: Configuration, repository_paths: RepositoryPaths) -> Task:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -6,24 +6,14 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "ahriman-triggers"
|
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 = [
|
dependencies = [
|
||||||
"ahriman-core",
|
"ahriman-core",
|
||||||
]
|
]
|
||||||
|
description = "ArcH linux ReposItory MANager, additional extensions"
|
||||||
dynamic = [
|
dynamic = [
|
||||||
"version",
|
"version",
|
||||||
]
|
]
|
||||||
|
requires-python = ">=3.13"
|
||||||
[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]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = [
|
packages = [
|
||||||
|
|||||||
@@ -6,13 +6,6 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "ahriman-web"
|
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 = [
|
dependencies = [
|
||||||
"ahriman-core",
|
"ahriman-core",
|
||||||
"aiohttp",
|
"aiohttp",
|
||||||
@@ -20,9 +13,11 @@ dependencies = [
|
|||||||
"aiohttp_jinja2",
|
"aiohttp_jinja2",
|
||||||
"aiohttp_sse",
|
"aiohttp_sse",
|
||||||
]
|
]
|
||||||
|
description = "ArcH linux ReposItory MANager, web server"
|
||||||
dynamic = [
|
dynamic = [
|
||||||
"version",
|
"version",
|
||||||
]
|
]
|
||||||
|
requires-python = ">=3.13"
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
auth = [
|
auth = [
|
||||||
@@ -42,11 +37,6 @@ oauth2 = [
|
|||||||
"aioauth-client",
|
"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]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = [
|
packages = [
|
||||||
"src/ahriman",
|
"src/ahriman",
|
||||||
|
|||||||
+5
-5
@@ -6,10 +6,6 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "ahriman"
|
name = "ahriman"
|
||||||
description = "ArcH linux ReposItory MANager"
|
|
||||||
readme = "README.md"
|
|
||||||
requires-python = ">=3.13"
|
|
||||||
license = { file = "COPYING" }
|
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "ahriman team" },
|
{ name = "ahriman team" },
|
||||||
]
|
]
|
||||||
@@ -18,14 +14,18 @@ dependencies = [
|
|||||||
"ahriman-triggers",
|
"ahriman-triggers",
|
||||||
"ahriman-web",
|
"ahriman-web",
|
||||||
]
|
]
|
||||||
|
description = "ArcH linux ReposItory MANager"
|
||||||
dynamic = [
|
dynamic = [
|
||||||
"version",
|
"version",
|
||||||
]
|
]
|
||||||
|
license = { file = "COPYING" }
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.13"
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
|
Changelog = "https://github.com/arcan1s/ahriman/releases"
|
||||||
Documentation = "https://ahriman.readthedocs.io/"
|
Documentation = "https://ahriman.readthedocs.io/"
|
||||||
Repository = "https://github.com/arcan1s/ahriman"
|
Repository = "https://github.com/arcan1s/ahriman"
|
||||||
Changelog = "https://github.com/arcan1s/ahriman/releases"
|
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
check = [
|
check = [
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ def import_error(package: str, components: list[str], mocker: MockerFixture) ->
|
|||||||
import builtins
|
import builtins
|
||||||
_import = builtins.__import__
|
_import = builtins.__import__
|
||||||
|
|
||||||
|
# pylint: disable=redefined-builtin
|
||||||
def test_import(name: str, globals: Any, locals: Any, from_list: list[str], level: Any):
|
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)):
|
if name == package and (not components or any(component in from_list for component in components)):
|
||||||
raise ImportError
|
raise ImportError
|
||||||
@@ -254,43 +255,6 @@ def configuration(repository_id: RepositoryId, tmp_path: Path, resource_path_roo
|
|||||||
path = resource_path_root / "core" / "ahriman.ini"
|
path = resource_path_root / "core" / "ahriman.ini"
|
||||||
|
|
||||||
instance = Configuration.from_path(path, repository_id)
|
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("repository", "root", str(tmp_path))
|
||||||
instance.set_option("settings", "database", str(tmp_path / "ahriman.db"))
|
instance.set_option("settings", "database", str(tmp_path / "ahriman.db"))
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "ahriman-pytest-plugins"
|
name = "ahriman-pytest-plugins"
|
||||||
version = "1"
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Framework :: Pytest",
|
"Framework :: Pytest",
|
||||||
]
|
]
|
||||||
|
version = "1"
|
||||||
|
|
||||||
[project.entry-points.pytest11]
|
[project.entry-points.pytest11]
|
||||||
ahriman-fixtures = "ahriman_fixtures"
|
ahriman-fixtures = "ahriman_fixtures"
|
||||||
|
|||||||
Reference in New Issue
Block a user