Open isohedronpipeline opened 6 months ago
Attention: Patch coverage is 76.19048%
with 15 lines
in your changes missing coverage. Please review.
Project coverage is 58.33%. Comparing base (
3c75a19
) to head (0af2985
). Report is 47 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
src/rez/package_order.py | 76.19% | 9 Missing and 6 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR carries on the work by @pmolodo (https://github.com/AcademySoftwareFoundation/rez/pull/355) to add a custom package order. This is essentially a generalization of the
version_split
package order, which provides better functionality for splitting versions within specified ranges, instead of only allowing a single split, asversion_split
does. This makes the package orderer useful outside of the extremely narrow band of intended uses that the version_split package order was intended to solve.CustomPackageOrder
This adds support to explicitly specify the way versions should resolve, while still providing flexibility for ranges. For example consider the following package
houdini
:And consider the following optional plugin
plugin
that has variants (all latest versions of Houdini):But let's consider that the latest version of Houdini is not well tested and we do not know if our pipeline will behave properly with these latest versions. On top of that, consider that we want
houdini-19.5
to be the default.Examples:
rez env houdini
resolves tohoudini-19.5.632
(not latest)rez env houdini plugin
resolves tohoudini-19.5.679
(19.5 version that is compatible with plugin)rez env houdini-20
resolves tohoudini-20.0.413
(not latest 20)rez env houdini plugin
resolves tohoudini-20.0.528
(20 version that is compatible with plugin)This is hard to achieve without explicit presets, which makes preference of second order dependencies very difficult to resolve without taking advantage of the graph evaluation of rez. More information here: https://docs.google.com/document/d/1zy3ydSpHWgvatFS--L2PK7AwwOaowr1sdI9B_2eNtFc/edit?usp=sharing
We can now achieve that with the CustomPackageOrder:
In the above package orderer, we see that we prefer
19.5.632
if no other version constraints are put on it. If 19.5.632 is not suitable (as in the case ofplugin
not having a requirement match) then we prefer the latest version that fits the VersionRange of19.5
. If that is not suitable, then we prefer20.0.413
to causehoudini-20
to resolve to a less-than-latest version of Houdini 20.Lastly, the CustomPackageOrder may take an argument to determine how versions within those version ranges are sorted, e.g. with pypa sorting.