sphinx-fortran icon indicating copy to clipboard operation
sphinx-fortran copied to clipboard

python3 compatibility

Open XonqNopp opened this issue 9 years ago • 11 comments

What about a transition to python3? ;-)

XonqNopp avatar Oct 26 '15 14:10 XonqNopp

Yep, it must be done. @tgastine tried to convert the code but he has trouble with unicode stuff.

stefraynaud avatar Oct 26 '15 16:10 stefraynaud

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.

tgastine avatar Oct 26 '15 16:10 tgastine

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.

mwilmer avatar Jan 10 '16 19:01 mwilmer

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 :-)

davidovitch avatar Aug 15 '17 14:08 davidovitch

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'

warrickball avatar Jun 11 '18 15:06 warrickball

Thanks @warrickball for reporting this. Can you make the pull request so that I can create a branch to test this?

stefraynaud avatar Jun 15 '18 07:06 stefraynaud

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.

mwilmer avatar Jun 19 '18 12:06 mwilmer

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...

warrickball avatar Jun 19 '18 12:06 warrickball

does anyone know the status of things here? Is there a plan to issue a pypi release with Python 3 support?

jhamman avatar Oct 09 '18 04:10 jhamman

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.

stefraynaud avatar Oct 09 '18 07:10 stefraynaud

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?

K20shores avatar Jul 15 '22 19:07 K20shores