Decouple non-UI CLI startup from config_ui
Stop aman.py from importing the GTK settings module at module load so version, init, bench, diagnostics, and top-level help can start without pulling in the UI stack.\n\nPromote PyGObject and python-xlib into main project dependencies, switch the documented source install surface to plain uv/pip commands, and teach the portable, deb, and Arch packaging flows to install filtered runtime requirements before the Aman wheel so they still rely on distro-provided GTK/X11 packages.\n\nAdd regression coverage for importing aman with config_ui blocked and for the portable bundle's new requirements payload, then rerun the focused CLI/diagnostics/portable tests plus py_compile.
This commit is contained in:
parent
b4a3d446fa
commit
721248ca26
15 changed files with 173 additions and 35 deletions
|
|
@ -14,6 +14,25 @@ sha256sums=('__TARBALL_SHA256__')
|
|||
prepare() {
|
||||
cd "${srcdir}/aman-${pkgver}"
|
||||
python -m build --wheel
|
||||
python - <<'PY'
|
||||
from pathlib import Path
|
||||
import re
|
||||
import tomllib
|
||||
|
||||
project = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))
|
||||
exclude = {"pygobject", "python-xlib"}
|
||||
dependencies = project.get("project", {}).get("dependencies", [])
|
||||
filtered = []
|
||||
for dependency in dependencies:
|
||||
match = re.match(r"\s*([A-Za-z0-9_.-]+)", dependency)
|
||||
if not match:
|
||||
continue
|
||||
name = match.group(1).lower().replace("_", "-")
|
||||
if name in exclude:
|
||||
continue
|
||||
filtered.append(dependency.strip())
|
||||
Path("dist/runtime-requirements.txt").write_text("\n".join(filtered) + "\n", encoding="utf-8")
|
||||
PY
|
||||
}
|
||||
|
||||
package() {
|
||||
|
|
@ -21,7 +40,8 @@ package() {
|
|||
install -dm755 "${pkgdir}/opt/aman"
|
||||
python -m venv --system-site-packages "${pkgdir}/opt/aman/venv"
|
||||
"${pkgdir}/opt/aman/venv/bin/python" -m pip install --upgrade pip
|
||||
"${pkgdir}/opt/aman/venv/bin/python" -m pip install "dist/aman-${pkgver}-"*.whl
|
||||
"${pkgdir}/opt/aman/venv/bin/python" -m pip install --requirement "dist/runtime-requirements.txt"
|
||||
"${pkgdir}/opt/aman/venv/bin/python" -m pip install --no-deps "dist/aman-${pkgver}-"*.whl
|
||||
|
||||
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/aman" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
|
|
|
|||
|
|
@ -358,6 +358,10 @@ def _copy_bundle_support_files(bundle_dir: Path, stage_dir: Path) -> None:
|
|||
def _run_pip_install(bundle_dir: Path, stage_dir: Path, python_tag: str) -> None:
|
||||
common_dir = _require_bundle_file(bundle_dir / "wheelhouse" / "common", "common wheelhouse")
|
||||
version_dir = _require_bundle_file(bundle_dir / "wheelhouse" / python_tag, f"{python_tag} wheelhouse")
|
||||
requirements_path = _require_bundle_file(
|
||||
bundle_dir / "requirements" / f"{python_tag}.txt",
|
||||
f"{python_tag} runtime requirements",
|
||||
)
|
||||
aman_wheel = _aman_wheel(common_dir)
|
||||
venv_dir = stage_dir / "venv"
|
||||
_run([sys.executable, "-m", "venv", "--system-site-packages", str(venv_dir)])
|
||||
|
|
@ -372,6 +376,22 @@ def _run_pip_install(bundle_dir: Path, stage_dir: Path, python_tag: str) -> None
|
|||
str(common_dir),
|
||||
"--find-links",
|
||||
str(version_dir),
|
||||
"--requirement",
|
||||
str(requirements_path),
|
||||
]
|
||||
)
|
||||
_run(
|
||||
[
|
||||
str(venv_dir / "bin" / "python"),
|
||||
"-m",
|
||||
"pip",
|
||||
"install",
|
||||
"--no-index",
|
||||
"--find-links",
|
||||
str(common_dir),
|
||||
"--find-links",
|
||||
str(version_dir),
|
||||
"--no-deps",
|
||||
str(aman_wheel),
|
||||
]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue