VACUMM / sphinx-fortran

Fortran domain and autodoc extensions to Sphinx
Other
45 stars 29 forks source link

python3 compatibility #2

Open XonqNopp opened 8 years ago

XonqNopp commented 8 years ago

What about a transition to python3? ;-)

stefraynaud commented 8 years ago

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

tgastine commented 8 years ago

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.

mwilmer commented 8 years ago

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.

davidovitch commented 7 years ago

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

warrickball commented 6 years ago

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'
stefraynaud commented 6 years ago

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

mwilmer commented 6 years ago

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.

warrickball commented 6 years ago

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

jhamman commented 5 years ago

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

stefraynaud commented 5 years ago

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.

K20shores commented 2 years ago

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?