-
Notifications
You must be signed in to change notification settings - Fork 421
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
Don't exit on compileall failure #1146
Conversation
Packages may include sources that are only valid and used on certain Python versions, in which case compileall will fail, but installation should still succeed.
Current coverage is 46.2% (diff: 0.0%)@@ master #1146 diff @@
==========================================
Files 43 43
Lines 5634 5634
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 2604 2604
Misses 3030 3030
Partials 0 0
|
This is a good way to do this, IMHO. Other people have discussed this at #789 #686 #715 My concerns here are:
For the latter, it is my understanding that there will be a speed hit in byte compiling the module each time, but it will not fundamentally break anything. If we want to keep .pyc files as part of conda packages (and @ilanschnell and @kalefranz have argued for this strongly internally), then I think a better approach to files that are known to not be compilable is to list them in meta.yaml, where selectors can be used, and then hide them somehow from the compileall call. |
Compilation still hits every file.
None that I'm aware of. In the cases I've seen, these are files that won't import on the Python versions where compilation fails (e.g. safely ignored Python 3-specific files installed on Python 2), so these files will never be imported. |
Thanks for this @minrk! I maintain a certain number of packages where I need to patch them (removing the py3k parts) to be able to build them. My approach is not sustainable and does not scale. I would love to start using this instead! |
OK, sounds good. Do you mind implementing a test to ensure that all files are compiled? Something like 2-3 files named such that the non compileable one is in the middle? Alternatively, if there are docs that specify the behavior, please add a comment to this pr pointed at those docs. |
@minrk, I'm hoping to tag a bugfix release later today. Do you want to get this in, or wait for 2.0 (in a couple of weeks)? |
Merging. This is important enough and you are important enough that I'll finish this up with a separate pr. Thanks @minrk |
Don't exit on compileall failure
Packages may include sources that are only valid and used on certain Python versions, in which case compileall will fail, but installation should still succeed.