Use JSON to communicate extra_pip_args to extract_wheels (#50)
diff --git a/defs.bzl b/defs.bzl index d46004b..1b82520 100644 --- a/defs.bzl +++ b/defs.bzl
@@ -37,7 +37,7 @@ if rctx.attr.extra_pip_args: args += [ "--extra_pip_args", - "\"" + " ".join(rctx.attr.extra_pip_args) + "\"", + struct(args = rctx.attr.extra_pip_args).to_json(), ] if rctx.attr.pip_data_exclude:
diff --git a/extract_wheels/__init__.py b/extract_wheels/__init__.py index c42965d..6cd8e5f 100644 --- a/extract_wheels/__init__.py +++ b/extract_wheels/__init__.py
@@ -75,7 +75,7 @@ pip_args = [sys.executable, "-m", "pip", "wheel", "-r", args.requirements] if args.extra_pip_args: - pip_args += args.extra_pip_args.strip("\"").split() + pip_args += json.loads(args.extra_pip_args)["args"] # Assumes any errors are logged by pip so do nothing. This command will fail if pip fails subprocess.run(pip_args, check=True)