Python dependencies with ordered comparison syntax

Hi @eirannejad !

We’ve bumped into this issue where the python ordered comparison syntax breaks the Script components (and the environment). So something like this # r: compas >=2.0, <3.0, which is how we sometimes specify our dependencies, results in:

Info 11/12/2025 08:47:25 [RhinoCode] Installing "compas>=2.0.0, <3.0"
Info 11/12/2025 08:47:25 [RhinoCode] Running process: C:\Users\ckasirer\.rhinocode\py39-rh8\python.exe -I -m pip --isolated --disable-pip-version-check install --target "C:\Users\ckasirer\.rhinocode\py39-rh8\site-envs\default-QLMRNq0_" --progress-bar off --upgrade --no-warn-script-location --retries 5 --timeout 15 "compas>=2.0.0" "<3.0"
Error 11/12/2025 08:47:27 [RhinoCode] Process exited with code 1
Error 11/12/2025 08:47:27 [RhinoCode] pip install error | 
ERROR: Invalid requirement: '<3.0': Expected package name at the start of dependency specifier
    <3.0
    ^

Shouldn’t the # r syntax support all the available specifiers in: PEP 440 – Version Identification and Dependency Specification | peps.python.org?

Thanks!

Chen

Oh this is a good one. I made this ticket for it. Thanks for reporting!

RH-90533 Python package spec format can specify upper bounds

amazing! thanks @eirannejad !