diff --git a/.gitlab/download-dependency-wheels.sh b/.gitlab/download-dependency-wheels.sh index 3282c2542d4..431e662e4c7 100755 --- a/.gitlab/download-dependency-wheels.sh +++ b/.gitlab/download-dependency-wheels.sh @@ -13,6 +13,8 @@ mkdir pywheels-dep cd pywheels +export PYTHONUNBUFFERED=TRUE + ../lib-injection/dl_wheels.py \ --python-version=$PYTHON_VERSION \ --local-ddtrace \ diff --git a/.gitlab/prepare-oci-package.sh b/.gitlab/prepare-oci-package.sh index 65d3d2c9c4d..5b3380bd4d9 100755 --- a/.gitlab/prepare-oci-package.sh +++ b/.gitlab/prepare-oci-package.sh @@ -7,7 +7,7 @@ fi if [ -z "$PYTHON_PACKAGE_VERSION" ]; then # Get the version from the filename of the first wheel # wheels have the form: - # ddtrace-2.11.0.dev41+g50bf57680-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.wh + # ddtrace-2.11.0.dev41+g50bf57680-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl # the version is everything between the first and second "-" WHEELS_LIST=(../pywheels/*.whl) FIRST_WHEEL=${WHEELS_LIST[1]} diff --git a/lib-injection/dl_wheels.py b/lib-injection/dl_wheels.py index f382491ec51..e10d8e53e0e 100755 --- a/lib-injection/dl_wheels.py +++ b/lib-injection/dl_wheels.py @@ -38,7 +38,6 @@ print( "WARNING: using known incompatible version, %r, of pip. The minimum compatible pip version is %r" % (pip_version, MIN_PIP_VERSION), - flush=True ) # Supported Python versions lists all python versions that can install at least one version of the ddtrace library. @@ -73,12 +72,12 @@ args = parser.parse_args() dl_dir = args.output_dir -print("saving wheels to %s" % dl_dir, flush=True) +print("saving wheels to %s" % dl_dir) for python_version, platform in itertools.product(args.python_version, args.platform): for arch in args.arch: - print("Downloading %s %s %s wheel" % (python_version, arch, platform), flush=True) + print("Downloading %s %s %s wheel" % (python_version, arch, platform)) abi = "cp%s" % python_version.replace(".", "") # Have to special-case these versions of Python for some reason. if python_version in ["2.7", "3.5", "3.6", "3.7"]: @@ -87,14 +86,12 @@ if args.ddtrace_version: ddtrace_specifier = "ddtrace==%s" % args.ddtrace_version elif args.local_ddtrace: - wheel_files = [f for f in os.listdir('.') if - f.endswith(".whl") - and abi in f - and platform in f - and arch in f] - - if (len(wheel_files) > 1): - print("More than one matching file found %s" % wheel_files, flush=True) + wheel_files = [ + f for f in os.listdir(".") if f.endswith(".whl") and abi in f and platform in f and arch in f + ] + + if len(wheel_files) > 1: + print("More than one matching file found %s" % wheel_files) sys.exit(1) ddtrace_specifier = wheel_files[0] @@ -119,12 +116,12 @@ abi, "--only-binary=:all:", "--exists-action", - "i", #ignore redownloads of same wheel + "i", # ignore redownloads of same wheel "--dest", dl_dir, ] if args.verbose: - print(" ".join(cmd), flush=True) + print(" ".join(cmd)) if not args.dry_run: subprocess.run(cmd, capture_output=not args.verbose, check=True) @@ -132,7 +129,7 @@ wheel_files = [f for f in os.listdir(dl_dir) if f.endswith(".whl")] for whl in wheel_files: wheel_file = os.path.join(dl_dir, whl) - print("Unpacking %s" % wheel_file, flush=True) + print("Unpacking %s" % wheel_file) # -q for quieter output, else we get all the files being unzipped. subprocess.run( [