8000 Use JSON to communicate extra_pip_args to extract_wheels (#50) · satishhiremath/rules_python@bd1f4be · GitHub
[go: up one dir, main page]

Skip to content

Commit bd1f4be

Browse files
Use JSON to communicate extra_pip_args to extract_wheels (bazel-contrib#50)
1 parent 2c78da5 commit bd1f4be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _pip_repository_impl(rctx):
3737
if rctx.attr.extra_pip_args:
3838
args += [
3939
"--extra_pip_args",
40-
"\"" + " ".join(rctx.attr.extra_pip_args) + "\"",
40+
struct(args = rctx.attr.extra_pip_args).to_json(),
4141
]
4242

4343
if rctx.attr.pip_data_exclude:

extract_wheels/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def main() -> None:
7575

7676
pip_args = [sys.executable, "-m", "pip", "wheel", "-r", args.requirements]
7777
if args.extra_pip_args:
78-
pip_args += args.extra_pip_args.strip("\"").split()
78+
pip_args += json.loads(args.extra_pip_args)["args"]
7979
# Assumes any errors are logged by pip so do nothing. This command will fail if pip fails
8080
subprocess.run(pip_args, check=True)
8181

0 commit comments

Comments
 (0)
0