diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index 6d02ce6e5..4cc3808da 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -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__": diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py index a6b08e3e0..f6f43fd68 100644 --- a/scripts/otel_packaging.py +++ b/scripts/otel_packaging.py @@ -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"],) )