Skip to content

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

Merged
agriyakhetarpal merged 5 commits into
pypa:mainfrom
agriyakhetarpal:fix-test-requires-quoting
Jun 13, 2026
Merged

agriyakhetarpal merged 5 commits into
pypa:mainfrom
agriyakhetarpal:fix-test-requires-quoting

Conversation

@agriyakhetarpal

@agriyakhetarpal agriyakhetarpal commented Jun 12, 2026 •

Copy link
Copy Markdown
Member

test-requires and audit-requires were formatted with a space-joined ListFormat(sep=" ") without any quoting and then split with .split(), and that breaks any requirement containing a space, such as a dependency specifier of the form

"pyzstd; python_version >= '3.14'"

test-sources correctly uses ListFormat(sep=" ", quote=shlex.quote) and shlex.split(), so this is a trivial fix where the same pattern should be applied for both places.

Closes #2912

  • Check if any other option(s) also have the same problem
  • Add a test

agriyakhetarpal added a commit to agriyakhetarpal/numcodecs that referenced this pull request Jun 12, 2026
agriyakhetarpal added a commit to agriyakhetarpal/numcodecs that referenced this pull request Jun 12, 2026
@agriyakhetarpal agriyakhetarpal changed the title Fix quoting of test-requires option for PEP 508 specifiers Fix quoting of test-requires and audit-requires options for PEP 508 specifiers Jun 12, 2026
@agriyakhetarpal
agriyakhetarpal marked this pull request as ready for review June 12, 2026 21:27

@henryiii henryiii left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I hit this bug before, and seems like I forgot to fix it. Or maybe it was just inside groups - actually, I think that was it.

@agriyakhetarpal
agriyakhetarpal merged commit 034e635 into pypa:main Jun 13, 2026
45 checks passed
@agriyakhetarpal
agriyakhetarpal deleted the fix-test-requires-quoting branch June 13, 2026 00:35
@joerick

joerick commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

good catch, thanks

justinjoy added a commit to semantic-reasoning/PyreWire that referenced this pull request Aug 7, 2026
Bumps pypa/cibuildwheel from v4.1.0 to v4.1.1 in the release and wheels
workflows.

test_wheel_workflows_use_cibuildwheel_v4_1_0 pins the exact cibuildwheel
version both wheel-building workflows must use, so the bump has to update
that guard in lockstep. Bumping the workflows alone fails CI, which is why
the Dependabot-only diff could not go green.

The guard is renamed to match the version it now asserts, and v4.1.0 joins
the list of superseded versions the workflows must not fall back to.

v4.1.1 is a patch release: no breaking changes, and its test-requires
quoting fix (pypa/cibuildwheel#2913) applies to the pytest/pytest-cov
test-requires this project already configures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot use dependency specifiers in test-requires

3 participants