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 creates .pyc files by default #816

Closed
instinct-vfx opened this issue Dec 4, 2019 · 6 comments · Fixed by #827
Closed

rez-pip creates .pyc files by default #816

instinct-vfx opened this issue Dec 4, 2019 · 6 comments · Fixed by #827
Labels
rez-pip ingesting py pkgs into rez (pip, wheels, etc)

Comments

@instinct-vfx
Copy link
Contributor

This is an issue if the installed package is a "pure" package (no binary components) because the pyc files might not work with other interpreters.

My proposal would be to add --no-compile to pip.py and not generate pyc files at all when using rez-pip.

@JeanChristopheMorinPerso
Copy link
Member

As discussed on slack, we should add an option called pip_extra_args (or something like that) configurable in the rezconfig so everybody can add settings that fits their needs.

For example, a studio could add a --index-url for example.

It will give us flexibility and will remove us some maintenance (maintaining the cli for pip arguments).

@JeanChristopheMorinPerso JeanChristopheMorinPerso added the rez-pip ingesting py pkgs into rez (pip, wheels, etc) label Dec 6, 2019
@nerdvegas
Copy link
Contributor

nerdvegas commented Dec 6, 2019 via email

@nebukadhezer
Copy link

-- target and --user are probably the two interesting ones where imho rez would always win, or is that needed and wanted that pip then reroutes the destination?

@lambdaclan
Copy link
Contributor

Hello everyone, I am working on implementing this as discussed above and based on the discussions you had in slack. The most elegant solution would of course be using the PYTHONWRITEBYTECODE environment variable but since it does not seem to be an option right now I have added the extra functionality to rez-pip cli and rezconfig. I will be submitting a PR soon 👍

@bpabel
Copy link
Contributor

bpabel commented Dec 16, 2019

This is solved by switching to python 3, correct? Python 3 writes .pyc files to a __pycache__ folder with the python version number, so that multiple versions of python will each have their own .pyc files.

This would only be an issue for people using different versions of python 2 (and I can't imagine anyone is using anything other than 2.7).

@instinct-vfx
Copy link
Contributor Author

I assume python3 fixes incompatible pyc files and possibly also the network load issue. However the case we are seeing is having two incompatible 2.7 interpreters (namely the official binary and the embedded one in 3dsmax).

Beyond that the extra-args make sense for other stuff like index-url as mentioned above (getting around with an env var, but would prefer to be more explicit).

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

Successfully merging a pull request may close this issue.

6 participants