From 0562760a41600c9ab348a9f87a1e342b3ba182e0 Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen Date: Fri, 3 Apr 2020 15:51:10 +0800 Subject: [PATCH] Don't import pyalpm globally so that lilac can be easily on non-Arch systems (e.g., Travis CI) --- lilac2/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lilac2/api.py b/lilac2/api.py index 683ad0ba..9e3d7c9d 100644 --- a/lilac2/api.py +++ b/lilac2/api.py @@ -16,7 +16,6 @@ import io import requests -import pyalpm from myutils import at_dir from htmlutils import parse_document_from_requests @@ -407,6 +406,10 @@ def git_rm_files(files: List[str]) -> None: def aur_pre_build( name: Optional[str] = None, *, do_vcs_update: Optional[bool] = None, ) -> None: + # import pyalpm here so that lilac can be easily used on non-Arch + # systems (e.g. Travis CI) + import pyalpm + if os.path.exists('PKGBUILD'): pkgver, pkgrel = get_pkgver_and_pkgrel() else: