- Now getting python packages using pip instead of the ubuntu versions. - System wide installations now aren't supported.
28 lines
905 B
Python
Executable file
28 lines
905 B
Python
Executable file
#!/usr/bin/env python3.7
|
|
|
|
# Copyright (C) 2018 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 dist_deps:
|
|
subprocess.run(["sudo", "apt-get", "-y", "install"] + list(dist_deps),
|
|
check=True)
|
|
if pip_deps:
|
|
subprocess.run(["python", "-m", "pip", "install"] + list(pip_deps),
|
|
check=True)
|
|
if pip3_deps:
|
|
subprocess.run(["python" + vigil.tools.PYTHON_VERSION, "-m", "pip",
|
|
"install"] + list(pip3_deps), check=True)
|