-
Notifications
You must be signed in to change notification settings - Fork 8
Update/fix the build system for Python 3, remove some old/broken/useless code #57
base: master
Are you sure you want to change the base?
Conversation
1) Strongly depend on Cython. Cython.Distutils confirmed present on win32/linux2 python2.7/python3.3 with cython 0.18. 2) Remove setup3k.py, setup.py is python2/python3 compatible now. 3) Hack around the patch.py step by defining DL_IMPORT at runtime. TODO: find out when exactly DL_IMPORT was removed and update version checks accordingly
|
I'd just like to say that Cython (and by extension Cython.Distutils) is not installed by default, which is the whole reason for the weak dependency on Cython. |
|
I'm pretty sure it is now. |
|
Yes, but the point is that @bastienleonard doesn't want to force people to install Cython in the first place. |
|
I'm not too sure it's that much of an issue, because Cython can be installed pretty much everywhere now without any issues. Even if Cython should stay a weak dependency, it needs to be done in a different way, e.g. by trying to import Cython.Distutils and only falling back to Cython-less builds if it's not present. |
|
Also, shipping pregenerated files with the package might break the build, especially on older Python versions. That's just a theory for now, but there can be API mismatches. |
|
Oh, I'm not saying I disagree; I'm just stating the reasoning for the weak dependency in the first place. |
|
I'm just stating my reasoning for relying on Cython. Also, it seems the (old) Arch package was already broken because the pregenerated stuff in there was for Python 2.7. Oops. |
setup.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DL_IMPORT(RTYPE)=RTYPE in at least Python 2.7 and up, though it's probably better to find the version where it was removed completely and only override from there up.
|
I don't provide Cython-generated .cpp files anymore, but I'm going to wait a bit before removing that feature.
Code generated by Cython should work with Python 2 and Python 3, as far as I know. |
|
Well, we can keep “Léonard” with some Unicode escape magic, but I'm not really sure it's worth it, it'll be like 10 lines of code just to replace one character... Also, Cython uses some version-specific hacks, especially for the older ones like 2.4 or 2.5. |
|
10 lines?
|
|
That won't work, it needs to parse the whole thing. |
|
|
Fixed. |
|
@shizmob: Python 3.3 has unicode literals, previous 3.x versions don't. http://www.python.org/dev/peps/pep-0414/ |
|
What about |
|
Works on 2.7/3.3, but I'm not sure about some of the earlier versions. |
|
I'd say or even author = 'Bastién Leonardi'
if bytes is str:
author = author.decode('utf-8')Works in Python 2.6, 2.7 and 3.3, should work in any 3.x version. |
|
Can anyone test with 2.5? |
|
It doesn't work in 2.5: http://codepad.org/cNMHLTxU However |
|
Then I guess the latter is safe to use. Updating now. |
|
👍 |
win32/linux2 python2.7/python3.3 with cython 0.18.
TODO: find out when exactly DL_IMPORT was removed and update version
checks accordingly