xonsh / lazyasd

Lazy & self-destructive tools for speeding up module imports
http://xon.sh
BSD 3-Clause "New" or "Revised" License
52 stars 8 forks source link

backport to Python 2.7 #6

Closed jason-s closed 6 years ago

jason-s commented 7 years ago

I'm using Python 2.7 + was able to use this module with a couple of modifications. I am not sure how to make it compatible with both.

Issues encountered:

jason-s commented 7 years ago

I'm not that familiar with pull requests; these changes probably need tweaking so as to not break Python 3.

I tried running py.test but it tells me

ImportError: No module named lazyasd
scopatz commented 6 years ago

Thanks for putting this in @jason-s! and sorry about the extreme delay. I have merged this in, but then taken a slightly different tactic with regards to supporting the two versions. The whole point of lazyasd is to make importing occur as fast as possible. So to that end, some of the fixes didn't make sense in Python 3 world.

I have therefor split the implementations out into separate 2 & 3 implementations, each of which is free to do what is fastest for them. Then setup.py chooses which version to copy over at install time. This is done so that the version doesn't have to be chosen at run time.

Thanks again!

scopatz commented 6 years ago

Also, I have put out a v0.1.4 release with this change