diff --git a/README.md b/README.md index ae1d42a..a5beb81 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/eris/eris/__main__.py b/eris/eris/__main__.py index 7a39a49..791db10 100755 --- a/eris/eris/__main__.py +++ b/eris/eris/__main__.py @@ -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"]: diff --git a/eris/eris/tools.py b/eris/eris/tools.py index 72dfe20..9d90ae8 100755 --- a/eris/eris/tools.py +++ b/eris/eris/tools.py @@ -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] diff --git a/packaging/Dockerfile.arch b/packaging/Dockerfile.arch new file mode 100644 index 0000000..7c2e0b5 --- /dev/null +++ b/packaging/Dockerfile.arch @@ -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 . diff --git a/packaging/make-readme.py b/packaging/make-readme.py index 525b386..ac3b491 100755 --- a/packaging/make-readme.py +++ b/packaging/make-readme.py @@ -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