textile / python-textile

A Python port of Textile, A humane web text generator
Other
69 stars 23 forks source link

Breaks on Python 3.2 #11

Closed Fantomas42 closed 10 years ago

Fantomas42 commented 10 years ago

Hello,

I suppose that is not big priority to support Python 3.2, but since this commit on this line: https://github.com/textile/python-textile/commit/1e5d98e5bedbc09939e0a506e6a4367fe56309e0#diff-bcabf8c90bd02845f81578f71c50c091R63 I could not install the library.

So I'm stuck with the version 2.1.5 of the library.

This issue only happen on Python 3.2, the version 3.1, 3.3, 3.4 are not affected.

Traceback on a Travis build: https://travis-ci.org/Fantomas42/django-blog-zinnia/jobs/33796226#L249

Regards

Fantomas42 commented 10 years ago

I have just seen the py32 branch. It is planned to merge it ?

ikirudennis commented 10 years ago

The issue with py32 is that I have been unable to find a way for the same code to work across all versions (I believe it's actually impossible, but if someone smarter than I wants to take it on, please do). Py32 removed unicode literals and will not run any code containing them. Py33 added them back, in part to make porting code across versions easier. So, there isn't really a way to merge the branch in, and until unicode literals are more officially deprecated (probably not until py3+ is more the outright standard), the py32 branch will likely be updated in parallel with the master/develop branches.

PyPI affords us the ability to upload version-specific builds, and that's what we've done here. pip should install the correct version from PyPI. I took a look at that traceback: is it using easy_install to install textile? If you can switch to pip somehow, I believe that might be the easiest solution for you.

rczajka commented 10 years ago

I've made a Python 3.2 compatible version.

It's still failing on PyPy, which I've seen added in tox.ini, but I understand there's no way it'll run on PyPy with regex dep, which is obviously a separate issue.

Fantomas42 commented 10 years ago

I will take a look on the code. Switching to pip is unfortunately impossible for me because I'm using zc.buildout to deploy my code, and internally use easy-install.

Fantomas42 commented 10 years ago

I will test a build with the @rczajka version.

Fantomas42 commented 10 years ago

https://travis-ci.org/Fantomas42/django-blog-zinnia/builds/36961291

I have a regression on each version of Python 3 when I use the patched version of textile: Maybe the issue is located in my code, but the tests previously passed.

TypeError: can't use a string pattern on a bytes-like object
rczajka commented 10 years ago

As far as I can tell, your Textile tests were never actually passing with Python 3, they were just always skipped, and now they're not because textile installed successfully. But maybe I'm missing something.

Anyway, it doesn't seem like this problem is caused by mu update. The problem is that you're passing bytes to Textile, while it expects a string (not sure, but I think it always did).

ikirudennis commented 10 years ago

Firstly, thank you SO MUCH, Radek, for putting the effort into trying to solve this issue.

Julien, you might be able to test what's really breaking by comparing the results to a test with the py32 branch. If the test still fails, then we know that line is the problem.

Unfortunately, I don't have a virtual machine with py32 at the moment, so I can't test it myself.

Fantomas42 commented 10 years ago

Effectively the texttile test was not run on Python 3, because the version 2.1.5 of Textile which was installed was not compatible with Python 3.

So the issue on the build is related to my code. For me the PR of Radek needs a final review and a merge.

Dennis what do you think about using Travis, for testing Textile on the different Python versions ?

Regards

Fantomas42 commented 10 years ago

https://travis-ci.org/Fantomas42/django-blog-zinnia/builds/37000627 Now my builds pass on Py3 with a fix on my code.

Thank you Radek

Now I will quietly wait for a new release of the package. :)

ikirudennis commented 10 years ago

I just uploaded version 2.2.0 which contains Radek's fixes.

Fantomas42 commented 10 years ago

Great, thanks you all !

@ikirudennis Just FYI, the release tag for 2.2.0 has not been pushed on Github.

ikirudennis commented 8 years ago

Hey, @Fantomas42 and anyone else who might be py32: Do you still need support for that version? There are other projects that are dropping support for it, and I think some new code doesn't work, and it's becoming more difficult to test against it. I've taken it out of travis while I've been doing some updates, since it was only returning errors. I'll add it back and see how it goes, but the next version may not support py32.

ikirudennis commented 8 years ago

Scratch that, I've got it all working again for py32.