eris/install-tools
Andrew Hamilton 9a7e936055 Only installing on Ubuntu.
- Its too much work to maintain dependencies across distros.
- Will need to use appimages, snaps or flatpaks for the other distributions.
2017-09-01 21:53:02 +01:00

27 lines
833 B
Python
Executable file

#!/usr/bin/env python3
# Copyright (C) 2017 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
import subprocess
import vigil.tools
pip_deps, pip3_deps, dist_deps = set(), set(), set()
for dependency in vigil.tools.dependencies():
if "/" in dependency:
pip_version, pip_dependency = dependency.split("/")
(pip_deps if pip_version == "pip" else pip3_deps).add(pip_dependency)
else:
dist_deps.add(dependency)
if pip_deps:
dist_deps.add("python-pip")
if pip3_deps:
dist_deps.add("python3-pip")
if dist_deps:
subprocess.check_call(["sudo", "apt-get", "-y", "install"] + list(dist_deps))
if pip_deps:
subprocess.check_call(["sudo", "pip", "install"] + list(pip_deps))
if pip3_deps:
subprocess.check_call(["sudo", "pip3", "install"] + list(pip3_deps))