Skip to content

Commit 9c834f0

Browse files
authored
Fix generate_instrumentation_bootstrap script on windows (#527)
1 parent a3ecbc1 commit 9c834f0

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

scripts/generate_instrumentation_bootstrap.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import logging
1919
import os
2020
import subprocess
21+
import sys
2122

2223
import astor
2324
import pkg_resources
@@ -91,7 +92,18 @@ def main():
9192
with open(gen_path, "w") as gen_file:
9293
gen_file.write(source)
9394

94-
subprocess.run(["black", "-q", gen_path], check=True)
95+
subprocess.run(
96+
[
97+
sys.executable,
98+
"scripts/eachdist.py",
99+
"format",
100+
"--path",
101+
"opentelemetry-instrumentation",
102+
],
103+
check=True,
104+
)
105+
106+
logger.info("generated %s", gen_path)
95107

96108

97109
if __name__ == "__main__":

scripts/otel_packaging.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ def get_instrumentation_packages():
2727
if not os.path.isdir(pkg_path):
2828
continue
2929

30-
out = str(
31-
subprocess.check_output(
32-
"python setup.py meta", shell=True, cwd=pkg_path
33-
)
30+
out = subprocess.check_output(
31+
"python setup.py meta",
32+
shell=True,
33+
cwd=pkg_path,
34+
universal_newlines=True,
3435
)
35-
instrumentation = json.loads(out.split("\\n")[1])
36+
instrumentation = json.loads(out.splitlines()[1])
3637
instrumentation["requirement"] = "==".join(
3738
(instrumentation["name"], instrumentation["version"],)
3839
)

0 commit comments

Comments
 (0)