Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_VersionRangeParser regex don't match range_desc example #1786

Open
doubleailes opened this issue Jul 2, 2024 · 3 comments
Open

_VersionRangeParser regex don't match range_desc example #1786

doubleailes opened this issue Jul 2, 2024 · 3 comments
Labels
api API related issues bug

Comments

@doubleailes
Copy link

doubleailes commented Jul 2, 2024

_VersionRangeParser regex don't match range_desc example see the "To Reproduce"section.

Environment

  • OS Rocky9.2
  • Rez version 3.1.1
  • Rez python version Python 3.11.9

To Reproduce

from rez.version._version import _VersionRangeParser, AlphanumericVersionToken

parser = _VersionRangeParser("<=2.0.0,1.0.0+",make_token=AlphanumericVersionToken)
print(parser._groups)

Expected behavior
returning something like this
{'range_desc': '<=2.0.0,1.0.0+', 'range_upper_desc': '<=2.0.0', 'range_upper_desc_prefix': '<=', 'range_upper_desc_version': '2.0.0', 'range_lower_desc': '1.0.0+', 'range_lower_desc_prefix': None, 'range_lower_desc_version': '1.0.0'}

Actual behavior

Traceback (most recent call last):
  File "xxx/python/test_regex.py", line 16, in <module>
    parser = _VersionRangeParser("<=2.0.0,1.0.0+",True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/.venv/lib/python3.11/site-packages/rez/version/_version.py", line 684, in __init__
    raise ParseException("Syntax error in version range '%s'" % part)
rez.version._util.ParseException: Syntax error in version range '<=2.0.0,1.0.0+'
@doubleailes doubleailes added the bug label Jul 2, 2024
@JeanChristopheMorinPerso
Copy link
Member

Hi @doubleailes, do you have more context around this? This class is not public and should not be used directly.

@doubleailes
Copy link
Author

doubleailes commented Jul 5, 2024

Hi @JeanChristopheMorinPerso ,

I was benching some part of Rez. And just found this error(?). No more context, than me messing around.

@JeanChristopheMorinPerso
Copy link
Member

Ok thanks for th additional info. I'll keep it open for a while, but I don't have the time to investigate if it's normal or not. Because it's an internal class and nobody has reported issues with public facing functions and classes, it's highly likely that it'll never be fixed (if it's a bug).

@JeanChristopheMorinPerso JeanChristopheMorinPerso added the api API related issues label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API related issues bug
Projects
None yet
Development

No branches or pull requests

2 participants