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

Don't exit on compileall failure #1146

Merged
merged 1 commit into from
Jul 30, 2016

Conversation

minrk
Copy link
Contributor

@minrk minrk commented Jul 26, 2016

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.

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.
@codecov-io
Copy link

Current coverage is 46.2% (diff: 0.0%)

Merging #1146 into master will not change coverage

@@             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          

Powered by Codecov. Last update ad695b3...176f2d0

@msarahan
Copy link
Contributor

This is a good way to do this, IMHO. Other people have discussed this at #789 #686 #715

My concerns here are:

  • does this approach simply stop compiling at the first failure?
  • what are the implications for usability on systems where the person using the package is not the person installing the package (and may not have write authority to write the .pyc)?

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.

@minrk
Copy link
Contributor Author

minrk commented Jul 26, 2016

does this approach simply stop compiling at the first failure?

Compilation still hits every file.

what are the implications for usability on systems where the person using the package is not the person installing the package (and may not have write authority to write the .pyc)?

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.

@ocefpaf
Copy link
Contributor

ocefpaf commented Jul 26, 2016

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!

@msarahan
Copy link
Contributor

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.

@msarahan
Copy link
Contributor

@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)?

@msarahan
Copy link
Contributor

Merging. This is important enough and you are important enough that I'll finish this up with a separate pr. Thanks @minrk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants