sphinx-fortran
sphinx-fortran copied to clipboard
python3 compatibility
What about a transition to python3? ;-)
Yep, it must be done. @tgastine tried to convert the code but he has trouble with unicode stuff.
Well, I basically made it work with python3 but it's actually rather tricky to ensure the backward compatibility with python2 due to unicode strings.
I have it working with Python3. I changed the print functions and the places where byte strings are decoded. Imported from future for backward compatibility, but I have not been able to test on Python2 yet.
If I can run some tests for Python2, would you @mwilmer be willing to create a PR? I've just used your fork on a very small PY3 project and it works at least for that one. Let me know if I can help in any other way. I think we should just fix this issue :-)
Is anyone working on this? I'm finding this module very useful so forked it and worked through the Python3 errors until I got something usable.
https://github.com/warrickball/sphinx-fortran/tree/python3
I'm willing to make the PR but I'm still new to them so I'm all ears if anyone has suggestions/advice/criticism/praise...
Also, for what it's worth, it looks like my changes preserve Python 2 compatibility, except that I had to give up on some dictionary sorting that gave errors like
File "/home/wball/code/sphinx-fortran/sphinxfortran/fortran_autodoc.py", line 1106, in format_quickaccess
flist.sort()
TypeError: '<' not supported between instances of 'dict' and 'dict'
Thanks @warrickball for reporting this. Can you make the pull request so that I can create a branch to test this?
My apologies for completely missing the previous request for a PR. Hope you get things integrated. @stefraynaud If help is needed from my side, please let me know.
In case in went unnoticed, I made the PR a few days ago: https://github.com/VACUMM/sphinx-fortran/pull/16
This is only the second time I've opened a PR so I'm not sure who gets notified of what...
does anyone know the status of things here? Is there a plan to issue a pypi release with Python 3 support?
Hi @jhamman
the python3 branch is already probably ok for being released with both py2 and py3 support. However, I don't have time to do it properly, with all needed tests.
I'll try to have a look at it.
I'm hitting the same issue that @warrickball stumbled upon. In fortran_autodoc.py, line 1246 of release version 1.1.1. It looks like that is already fixed in the current file. Can we get a new release?