packaging: Install on arch distros

This commit is contained in:
Andrew Hamilton 2023-09-18 02:08:19 +10:00
parent d5122f833a
commit 617afcb6b9
5 changed files with 41 additions and 12 deletions

View file

@ -6,14 +6,14 @@ Eris maintains an up-to-date set of reports for every file in a codebase.
## Installation
#### Debian / Ubuntu / Fedora
#### Debian / Ubuntu / Fedora / Arch
Install eris with pipx, then install all the tools eris uses:
pipx install --system-site-packages git+https://gitlab.com/ahamilton/eris@v2023.09.11#subdirectory=eris
eris --install-all-tools
Or install from source: (including tools)
Or install from source: (includes tools)
git clone https://gitlab.com/ahamilton/eris
cd eris

View file

@ -1145,14 +1145,27 @@ def check_arguments():
if arguments["--install-all-tools"]:
print("Installing all tools… (requires sudo)")
tools_ = tools.dependencies()
package_manager = "apt"
if "ID=fedora\n" in open("/etc/os-release"):
os_release_lines = open("/etc/os-release").readlines()
if "ID=fedora\n" in os_release_lines:
tools_.remove("lua-check")
fedora_rename = {"lua5.3": "lua", "python3-bandit": "bandit",
"ruby3.1": "ruby", "xz-utils": "xz"}
tools_ = [fedora_rename.get(tool, tool) for tool in tools_]
package_manager = "dnf"
subprocess.run(["sudo", package_manager, "-y", "install"] + sorted(tools_), check=True)
renames = {"lua5.3": "lua", "python3-bandit": "bandit",
"ruby3.1": "ruby", "xz-utils": "xz"}
tools_ = [renames.get(tool, tool) for tool in tools_]
subprocess.run(["sudo", "dnf", "-y", "install"] + sorted(tools_), check=True)
elif "ID=arch\n" in os_release_lines:
tools_.remove("rakudo")
tools_.remove("python3-pdfminer") # pdf2txt is not in arch
tools_.remove("perl-doc") # perldoc is in perl but not in the path
renames = {"genisoimage": "cdrkit", "lua5.3": "lua", "ruby3.1": "ruby",
"xz-utils": "xz", "g++": "gcc", "golang-go": "go", "lua-check": "luacheck",
"php-cli": "php", "pylint": "python-pylint", "python3-bandit": "bandit",
"python3-mypy": "mypy"}
tools_ = [renames.get(tool, tool) for tool in tools_]
tools_ = ["python-" + tool[len("python3-"):] if tool.startswith("python3-") else tool
for tool in tools_]
subprocess.run(["sudo", "pacman", "--noconfirm", "-S"] + sorted(tools_), check=True)
else: # debian / ubuntu
subprocess.run(["sudo", "apt", "-y", "install"] + sorted(tools_), check=True)
print("Done.")
sys.exit(0)
if arguments["--info"]:

View file

@ -240,7 +240,7 @@ def python_unittests(path):
@deps(deps={"python3-pytest", "python3-pytest-cov"},
url="https://docs.pytest.org/en/latest/", executables={"pytest-3"})
url="https://docs.pytest.org/en/latest/", executables={"pytest"})
def pytest(path):
command = [PYTHON_EXECUTABLE, "-m", "pytest", "--cov=.",
"--doctest-modules", "--color=yes", path]

16
packaging/Dockerfile.arch Normal file
View file

@ -0,0 +1,16 @@
FROM archlinux
RUN pacman -Sy
RUN pacman --noconfirm -S python-pipx gcc python-devtools
COPY . eris
RUN PIPX_BIN_DIR=/bin pipx install --system-site-packages ./eris/eris
RUN chmod a+rwx -R /root
RUN pacman --noconfirm -S sudo
RUN eris --install-all-tools
ENTRYPOINT ["eris"]
# docker build -t eris -f packaging/Dockerfile.arch .

View file

@ -22,14 +22,14 @@ Eris maintains an up-to-date set of reports for every file in a codebase.
## Installation
#### Debian / Ubuntu / Fedora
#### Debian / Ubuntu / Fedora / Arch
Install eris with pipx, then install all the tools eris uses:
pipx install --system-site-packages git+https://gitlab.com/ahamilton/eris@v2023.09.11#subdirectory=eris
eris --install-all-tools
Or install from source: (including tools)
Or install from source: (includes tools)
git clone https://gitlab.com/ahamilton/eris
cd eris