Open lpequignot opened 1 year ago
I'm wondering if it has to do with https://github.com/AcademySoftwareFoundation/rez/blob/main/src/rez/utils/pip.py#L378-L385.
Yes, the error comes from prefect rather than rez as prefect requirements use ruamel-yaml >= 0.17.0 instead of ruamel.yaml >= 0.17.0 Maybe I can ask if it's possible to change it.
You can definitely request to have it changed, or even better, open a PR :) But it doesn't change the fact that we have a bug, and a rather serious one IMO.
As for my last reply, my comment was about the fact that we do a mapping between uppercased and lowercased packages. So maybe we should do something like this but for -
and .
... But I have no idea how we should do it and how safe it is to do...
Ok, I took a deeper look and I think I understand what's going on. https://github.com/AcademySoftwareFoundation/rez/blob/main/src/rez/utils/pip.py#L42 only replaces -
with _
. If we were to also replace .
with _
, I think it would fix the issue. So my initial guess was approximately right.
Fixing this would probably be kind of a breaking change though. I will definitely fix it in https://github.com/JeanChristopheMorinPerso/rez-pip, but I have no plans to fix it in rez itself for now.
Hi,
For the follow up, I've created a PR for prefect requirements https://github.com/PrefectHQ/prefect/pull/10987 It has been approved and merged this morning.
Thank you
Hi,
We are using prefect package https://github.com/PrefectHQ/prefect and we are using rez and rez pip to install it. One of it's dependencies is ruamel.yaml, package with a dot in the name. The issue is that it creates a ruamel.yaml rez package on disk but it's adding "ruamel_yaml-0.17.0+" in prefect package.py requires as follow.
So, once we want to rez-env prefect it fails with the following error. 12:15:03 ERROR PackageFamilyNotFoundError: package family not found: ruamel_yaml, was required by: prefect
It seems to be due to the fact that in prefect requirements it's written ruamel-yaml >= 0.17.0 https://github.com/PrefectHQ/prefect/blob/main/requirements.txt#L34
And in rez
pip_to_rez_package_name
it's converting "-" to "_" https://github.com/AcademySoftwareFoundation/rez/blob/main/src/rez/utils/pip.py#L27Do you have a suggestion on how we could solve this (in our rez config , or with a hook maybe) ?
Regards,
Louise
Environment
To Reproduce
Expected behavior package name in requires is the same as the rez package installed,
Actual behavior It creates a ruamel.yaml rez package on disk but it's adding "ruamel_yaml-0.17.0+" in prefect package.py requires. rez-env prefect fails with 12:15:03 ERROR PackageFamilyNotFoundError: package family not found: ruamel_yaml, was required by: prefect
Related Issues/PRs
897