Skip to content

Cannot use dependency specifiers in test-requires #2912

Description

@agriyakhetarpal

Description

Came across this in zarr-developers/numcodecs#529 when testing cibuildwheel v4.1.0.

  + pip install pytest 'pyzstd;' python_version '>=' ''"'"'3.14'"'"'' msgpack crc32c zfpy 'zarr>=3' importlib_metadata
  ERROR: Invalid requirement: '>=': Expected package name at the start of dependency specifier
      >=
      ^

This happens when I do something like:

[[tool.cibuildwheel.overrides]]
select = "*-pyodide_wasm32"
config-settings = {setup-args = ["-Dsse2=disabled", "-Davx2=disabled"]}
test-requires = [
  "pytest",
  "pyzstd; python_version >= '3.14'",
  "msgpack",
  "crc32c",
  "zfpy",
  "zarr>=3",
  "importlib_metadata",
]

I have a workaround for now, where I can do:

[[tool.cibuildwheel.overrides]]
# pyzstd depends on backports-zstd (no wasm32 wheel) on Python < 3.14.
# On 3.14+ it has no extra deps and uses the stdlib compression.zstd
select = "cp314-pyodide_wasm32"
test-requires = [
  "pytest",
  "pyzstd",
  "msgpack",
  "crc32c",
  "zfpy",
  "zarr>=3",
  "importlib_metadata",
]

for Pyodide 314.0.0, but obviously it causes some repetition.

Build log

https://github.com/zarr-developers/numcodecs/actions/runs/27441719109/job/81117125162?pr=529

CI config

zarr-developers/numcodecs#529

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions