Fix generate_instrumentation_bootstrap script on windows (#527)
This commit is contained in:
parent
a3ecbc1f41
commit
9c834f0881
|
|
@ -18,6 +18,7 @@ import ast
|
|||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import astor
|
||||
import pkg_resources
|
||||
|
|
@ -91,7 +92,18 @@ def main():
|
|||
with open(gen_path, "w") as gen_file:
|
||||
gen_file.write(source)
|
||||
|
||||
subprocess.run(["black", "-q", gen_path], check=True)
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"scripts/eachdist.py",
|
||||
"format",
|
||||
"--path",
|
||||
"opentelemetry-instrumentation",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
|
||||
logger.info("generated %s", gen_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
|
|
@ -27,12 +27,13 @@ def get_instrumentation_packages():
|
|||
if not os.path.isdir(pkg_path):
|
||||
continue
|
||||
|
||||
out = str(
|
||||
subprocess.check_output(
|
||||
"python setup.py meta", shell=True, cwd=pkg_path
|
||||
)
|
||||
out = subprocess.check_output(
|
||||
"python setup.py meta",
|
||||
shell=True,
|
||||
cwd=pkg_path,
|
||||
universal_newlines=True,
|
||||
)
|
||||
instrumentation = json.loads(out.split("\\n")[1])
|
||||
instrumentation = json.loads(out.splitlines()[1])
|
||||
instrumentation["requirement"] = "==".join(
|
||||
(instrumentation["name"], instrumentation["version"],)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue