Fix quoting of test-requires and audit-requires options for PEP 508 specifiers (#2913)

This commit is contained in:
Agriya Khetarpal
2026-06-13 06:04:58 +05:30
committed by GitHub
parent 2947353127
commit 034e6353e8
4 changed files with 52 additions and 7 deletions
+10 -6
View File
@@ -833,9 +833,11 @@ class Options:
msg = f"Failed to parse test runtime config. {e}"
raise errors.ConfigurationError(msg) from e
test_requires = self.reader.get(
"test-requires", option_format=ListFormat(sep=" ")
).split()
test_requires = shlex.split(
self.reader.get(
"test-requires", option_format=ListFormat(sep=" ", quote=shlex.quote)
)
)
test_extras = self.reader.get("test-extras", option_format=ListFormat(sep=","))
test_groups_str = self.reader.get("test-groups", option_format=ListFormat(sep=" "))
test_groups = [x for x in test_groups_str.split() if x]
@@ -932,9 +934,11 @@ class Options:
)
audit_command = audit_command_str.split(" && ") if audit_command_str else []
audit_requires = self.reader.get(
"audit-requires", option_format=ListFormat(sep=" ")
).split()
audit_requires = shlex.split(
self.reader.get(
"audit-requires", option_format=ListFormat(sep=" ", quote=shlex.quote)
)
)
return BuildOptions(
globals=self.globals,