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

rez-pip - no case for ../../include/... file #861

Closed
smaragden opened this issue Mar 4, 2020 · 3 comments · Fixed by #866
Closed

rez-pip - no case for ../../include/... file #861

smaragden opened this issue Mar 4, 2020 · 3 comments · Fixed by #866
Labels
bug rez-pip ingesting py pkgs into rez (pip, wheels, etc)

Comments

@smaragden
Copy link
Contributor

smaragden commented Mar 4, 2020

I found an issue with rez-pip trying to install greenlet.
This is due to a similar case as here:
https://github.com/nerdvegas/rez/blob/49cae49a9dd4376b9efb6d571713b716d315b32b/src/rez/pip.py#L426-L432

We need to check for packages reporting files as ../../include/... as well.

To replicate:
rez-pip -i greenlet

@smaragden
Copy link
Contributor Author

I found another issue with:

rez-pip -i Qt.py
RuntimeError: ("Don't know what to do with source file %r, please file a ticket", u'../../LICENSE')

It looks like the ../../include files in greenlet comes from the headers kwarg to setup() in setup.py and should probably be handled. They only seem to be used at build time and are not installed by pip. For now I just install them to {root}/include/

the LICENSE in Qt.py comes from the data_files kwarg without a mapping.
It looks like this is bad practice if you read the docs at:
https://docs.python.org/2/distutils/setupscript.html#installing-additional-files

For now i put those files in {root}/

I do get why you raise as it's impossible to know the purpose of these files.

@j0yu
Copy link
Contributor

j0yu commented Mar 15, 2020

Hey, I written the patch for the original PR for the ../../include/python:

I do agree, it seems like the problem is a bit bigger than just ../../include/python, I ran into this today pip installing ranger:

rez pip --install ranger-fm
# RuntimeError: ("Don't know what to do with source file %r, please file a ticket", u'../../share/applications/ranger.desktop')

I don't think this idea is going to be good but, what do you think of:

  1. if ../../*** is detected, and rez does not know how to handle it,
  2. Throw a warning
  3. Substitute the leading ../../ with {root}/, install and carry on.

Maybe for step 1, there could be a new setting, e.g. pip_remaps dictionary, for re-mapping unknown file paths in the rez config.py so at least users perform their own substitutions/fixes.

But for now, I think it will be nice and easy to at least fix the error message, which is not formatted correctly.

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 16, 2020 via email

@JeanChristopheMorinPerso JeanChristopheMorinPerso added bug rez-pip ingesting py pkgs into rez (pip, wheels, etc) labels Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rez-pip ingesting py pkgs into rez (pip, wheels, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants