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

Python 3 compatibility? #101

Open
olebole opened this issue Aug 13, 2017 · 19 comments
Open

Python 3 compatibility? #101

olebole opened this issue Aug 13, 2017 · 19 comments

Comments

@olebole
Copy link

olebole commented Aug 13, 2017

Hi,

I am working on the Python 3 compatibility of gavodachs, which has newvow as dependency. Therefore, I am wondering whether nevow is Python 3 compatible resp. if there are any short-term plans to do so?

(Debian has only a Python 2 package, that's why I am asking)

@mithrandi
Copy link
Contributor

I don't think there are any plans to port Nevow to Python 3 at this stage. The project is mostly in "maintenance mode", and I suspect that a port would be quite tricky given some hairy things that are done in Nevow's internals. For gavodachs you may have an easier time porting from nevow to twisted.web (and twisted.web.template) than porting nevow itself to Python 3.

@wthie
Copy link
Contributor

wthie commented May 22, 2018

Aloha
just made some progress on this, there is a fork over at https://github.com/msdemlei/nevow.git which has advanced by the work of Markus to the point where a good part of nevow is operational. I'm currently working on getting node.js to digest the test code and made some progress in this area too. My main objective is getting athena to py3 as a lot of my work is based upon it.

@exarkun
Copy link
Member

exarkun commented Mar 24, 2019

@wthie Do you have any plans to contribute your changes upstream? It would be nice to avoid folks duplicating your efforts and it would be nice if the "nevow" package (on pypi, etc) had Python 3 support instead of folks having to find a random fork on github.

(cc @pythonhacker @heartsucker)

@wthie
Copy link
Contributor

wthie commented Mar 24, 2019 via email

@olebole
Copy link
Author

olebole commented Mar 25, 2019

@wthie -- do you coordinate with @msdemlei with the patches? Would be great if a fork could be avoided.

@sandrotosi
Copy link

@wthie did you make any progress in getting your changes ready for upstream nevow? Debian is in the process of removing Python2, and nevow is still py2 only, which makes it at risk of being removed.

@wthie
Copy link
Contributor

wthie commented Feb 1, 2020 via email

@wthie
Copy link
Contributor

wthie commented Oct 19, 2020

Aloha

With Matthias Demleitner having done the bulk of the work of porting nevow to Python3 and me tackling the nevow/athena part I now have the tests down to

FAILED (skips=4, expectedFailures=1, failures=1, successes=1037)

which pretty much compares to what I see running the tests on Python2

PASSED (skips=4, expectedFailures=2, successes=1043)

I have attached the two output files produced when running

trial nevow

I understand that I'm possibly the last one to use nevow but I have a few successful projects in production which rely nevow/athena and the Livepage implementation. These projects I will now subsequently port to Python3 as well.

My question to the few still on this mailing list is - how do I handle the merge back into the nevow project on github? I'm asking because this work was not done in manageable junks with reviews but more in a single battle style relying completely on the validity of the test suit.

Mahalo, Werner

res2.txt
res3.txt

@mithrandi
Copy link
Contributor

I think putting your whole branch up in a PR is where we should start; from there we can look at cherry-picking some of the changes into smaller branches, with the help of tools like pyupgrade.

@wthie
Copy link
Contributor

wthie commented Nov 5, 2020 via email

@vai-brma
Copy link

vai-brma commented Dec 2, 2020

We have a large project running with Python 2.7 and twisted/nevow. We are under pressure to upgrade to Python 3. Replacing nevow would be a huge amount of work.
Is there a chance that nevow will be Python 3 compatible this year?
thanks,

@wthie
Copy link
Contributor

wthie commented Dec 2, 2020

From my own application porting experience so far I'm currently mired in the flatteners having used a mixture of different loaders in my projects. This mixture has proven so far to be quite difficult to manage due to the string/byte array conversions and checks for proper formats in the nevow code base, seeing exceptions has become the new normal.

I'm under quite some time pressure with my projects but will try to do the PR before the end of the year, hopefully with a clearer idea of how the flattener code could be improved.

Werner

@exarkun
Copy link
Member

exarkun commented Dec 2, 2020

Can I suggest once more that you submit whatever porting work you've already completed? Even if you port all of Nevow next week, the chances of a single PR porting all 16000-some lines of Nevow is going to be meaningfully reviewed anytime soon.

As far as replacing Nevow goes, Tahoe-LAFS has recently finished replacing Nevow with Twisted.Web. It was not a small project but it was also doable. Even if it seems untenable I'd suggest considering that route. At the end, you not only end up with something Python 3 compatible, but you drop a dependency and you get Twisted.Web's improved flattener and the benefit of all the rest of Twisted Web's maintenance (only some of which you can benefit from via Nevow due to Nevow taking over large parts of how requests are handled). A lot of what you get from Nevow is just misfeatures anyway, and moving to Twisted Web is a good way to be sure you're not using those.

@msdemlei
Copy link

msdemlei commented Dec 3, 2020 via email

@exarkun
Copy link
Member

exarkun commented Dec 3, 2020

The linked repo seems private, fwiw.

@msdemlei
Copy link

msdemlei commented Dec 3, 2020 via email

@wthie
Copy link
Contributor

wthie commented Dec 4, 2020

PR is up

@vai-brma
Copy link

vai-brma commented Dec 4, 2020

Thanks for all your suggestions and effort Mr. wthie. I have a few options to consider now.

@perkinslr
Copy link

I'm sorry I somehow missed this go by. I ported the majority of epsilon, axiom, and nevow to python3.5 back in 2016. Since this project was in maintenance mode, and my port was not exactly clean (the goal was to make it work correctly, not make it pretty), I did not open an issue/PR at the time for python3 support. Nevertheless, I've been using it in production since, and it's been rock-solid stable. I can probably open a PR for it, at least that would help people find it to get up and running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants