rules_pycross icon indicating copy to clipboard operation
rules_pycross copied to clipboard

Errors on `0.8.0` with Python `3.9.16`

Open njlr opened this issue 3 months ago • 2 comments

Attempting to update to 0.8.0 gives this error:

  File "/private/var/tmp/_bazel_njlr/cf3a1f686181ca50d9789d140b5a47e2/external/rules_pycross~~pycross~rules_pycross_internal/exec_venv/lib/python3.12/site-packages/packaging/specifiers.py", line 245, in __init__
    raise InvalidSpecifier(f"Invalid specifier: '{spec}'")
packaging.specifiers.InvalidSpecifier: Invalid specifier: '3.9.16'

Is 3.9.16 still supported?

njlr avatar Sep 04 '25 12:09 njlr

Hi @njlr

Are you able to share any more of the stack trace? As it says, 3.9.16 isn't valid. It would need to be ==3.9.16, >=3.9.16, etc. PEP-440 stuff.

But I'm not sure where this value is coming from.

jvolkman avatar Sep 25 '25 00:09 jvolkman

Hi @njlr

Are you able to share any more of the stack trace? As it says, 3.9.16 isn't valid. It would need to be ==3.9.16, >=3.9.16, etc. PEP-440 stuff.

But I'm not sure where this value is coming from.

Doing a find and replace of "3.9.16" with "==3.9.16" in pyproject.toml and poetry.lock files seems to have fixed it.

It could be the Poetry version - is there a list of supported versions?

I am on 1.8.4

njlr avatar Sep 25 '25 09:09 njlr

I hit this too. It appears that Poetry accepts the ^<version> format for the project's own python version, and reflects it verbatim to poetry.lock instead of converting it to a PEP 440-compatible format. Should this be a Poetry bug, or should rules_pycross handle that?

sin-ack avatar Nov 21 '25 10:11 sin-ack