rez-pip icon indicating copy to clipboard operation
rez-pip copied to clipboard

Package names inconsistent between requirements and installed packages

Open JeanChristopheMorinPerso opened this issue 1 year ago • 1 comments

See https://github.com/AcademySoftwareFoundation/rez/issues/1545.

Basically, there is an inconsistency between the packages we install, and the packages that we put in the requirements. On top of the issue reported in the linked issue, the new rez-pip also has problems with uppercased vs lowercased packages.

Package name canonization is annoying... https://blog.piwheels.org/canonicalise-all-the-things/.

We can fix this issue by changing https://github.com/JeanChristopheMorinPerso/rez-pip/blob/9c61a5d2420c3e2da2fc3e8dddc85d9de1e83f75/src/rez_pip/utils.py#L39 to always lower-case the name and also replace . with _.

To confirm that it really works, we can run REZ_PACKAGES_PATH=~/rez_packages rez-pip2 prefect==2.13.6 -p /tmp/asd --python-version 3.9 -- -v and then rez-env prefect and it should work.

We might want to also print a report at the end with a mapping between the original names and the new names if it's possible to do. We might also want to harmonize the names across the logs.

Hello ! I think I just ran in the issue when trying to install sphinx==7.2.6.

$ rez env sphinx furo
12:40:45 ERROR    PackageFamilyNotFoundError: package family not found: sphinx (searched: C:\Users\lcoll\rez\packages; N:\packages; Z:\rez\packages)
$ rez env Sphinx furo
12:40:56 ERROR    PackageFamilyNotFoundError: package family not found: babel, was required by: Sphinx (searched: C:\Users\lcoll\rez\packages; N:\packages; Z:\rez\packages)

Is the corresponding PR for that issue considered done ? Or any help needed to get it merge ? Cheers.

MrLixm avatar Jan 12 '24 13:01 MrLixm