tools: Make go tools install using 'go get'.
This commit is contained in:
parent
d62010a1e0
commit
92b99d9b23
3 changed files with 15 additions and 8 deletions
|
|
@ -457,8 +457,8 @@ def pil(path):
|
||||||
return Status.normal, result
|
return Status.normal, result
|
||||||
|
|
||||||
|
|
||||||
@deps(deps={"golang-golang-x-tools"}, url="golang-golang-x-tools",
|
@deps(deps={"go/github.com/golang/go/src/cmd/godoc" },
|
||||||
executables={"godoc"})
|
url="https://github.com/golang/go", executables={"godoc"})
|
||||||
def godoc(path):
|
def godoc(path):
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
symlink_path = os.path.join(temp_dir, "file.go")
|
symlink_path = os.path.join(temp_dir, "file.go")
|
||||||
|
|
|
||||||
|
|
@ -229,11 +229,13 @@ tools_for_extensions = [
|
||||||
command = "luacheck"
|
command = "luacheck"
|
||||||
|
|
||||||
[go_vet]
|
[go_vet]
|
||||||
dependencies = ["golang-go", "go/github.com/golang/go/src/cmd/vet"]
|
dependencies = ["go/github.com/golang/go/src/cmd/vet"]
|
||||||
command = "go vet"
|
url = "https://github.com/golang/go"
|
||||||
|
command = "vet"
|
||||||
|
|
||||||
[golint]
|
[golint]
|
||||||
dependencies = ["golint", "go/github.com/golang/lint/golint"]
|
dependencies = ["go/github.com/golang/lint/golint"]
|
||||||
|
url = "https://github.com/golang/lint"
|
||||||
command = "golint -set_exit_status"
|
command = "golint -set_exit_status"
|
||||||
|
|
||||||
[yamllint]
|
[yamllint]
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,12 @@ import subprocess
|
||||||
import eris.tools
|
import eris.tools
|
||||||
|
|
||||||
|
|
||||||
pip_deps, dist_deps = set(), set()
|
pip_deps, go_deps, dist_deps = set(), set(), set()
|
||||||
|
dep_types = {"pip": pip_deps, "go": go_deps}
|
||||||
for dependency in eris.tools.dependencies():
|
for dependency in eris.tools.dependencies():
|
||||||
if "/" in dependency:
|
if "/" in dependency:
|
||||||
pip_version, pip_dependency = dependency.split("/")
|
dep_type, dep = dependency.split("/", maxsplit=1)
|
||||||
pip_deps.add(pip_dependency)
|
dep_types[dep_type].add(dep)
|
||||||
else:
|
else:
|
||||||
dist_deps.add(dependency)
|
dist_deps.add(dependency)
|
||||||
if dist_deps:
|
if dist_deps:
|
||||||
|
|
@ -21,3 +22,7 @@ if dist_deps:
|
||||||
if pip_deps:
|
if pip_deps:
|
||||||
subprocess.run(["python" + eris.tools.PYTHON_VERSION, "-m", "pip",
|
subprocess.run(["python" + eris.tools.PYTHON_VERSION, "-m", "pip",
|
||||||
"install"] + list(pip_deps), check=True)
|
"install"] + list(pip_deps), check=True)
|
||||||
|
if go_deps:
|
||||||
|
subprocess.run(["sudo", "apt-get", "-y", "install", "golang-go"],
|
||||||
|
check=True)
|
||||||
|
subprocess.run(["go", "get", "-u"] + list(go_deps), check=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue