AcademySoftwareFoundation / rez

An integrated package configuration, build and deployment system for software
https://rez.readthedocs.io
Apache License 2.0
956 stars 341 forks source link

Weak Requirement Range Causes Conflict #1824

Open Anti-Distinctlyminty opened 2 months ago

Anti-Distinctlyminty commented 2 months ago

The weak requirement ~houdini-19+<=20.5 causes a conflict when using the package houdini-20.5.

I thought that by default if a minor/patch version is not specified, then it means "all are ok". But this appears to not be the case.

Environment

To Reproduce

  1. Create two packages, one defining houdini-20.5, the other with the requirement ~houdini-19+<=20.5.
  2. Attempt a rez-env

Expected behavior houdini-20.5 should be accepted by the requirement ~houdini-19+<=20.5.

Actual behavior image

JeanChristopheMorinPerso commented 2 months ago

This is expected AFAIK:

>>> ver_range = rez.version.VersionRange('houdini-19+<=20.5')
>>> ver_range.contains_version(rez.version.Version('20.5.278'))
False

20.5.278 is greater than 20.5 here.

Anti-Distinctlyminty commented 2 months ago

Fair enough. Might be a point for the docs, unless I'm the only one who was caught out by this :)

JeanChristopheMorinPerso commented 1 month ago

Sure thing @Anti-Distinctlyminty. Would you like to submit a pull request to improve our docs in that area?

Anti-Distinctlyminty commented 1 month ago

Absolutely. I'll add it to my todo list :)

AHB102 commented 4 days ago

@Anti-Distinctlyminty Would you like to proceed with a PR, or should I close this issue?