-
Notifications
You must be signed in to change notification settings - Fork 60
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
Please port doconce so that it runs on python2.7 and python 3.4 both #38
Comments
Believe, I am using reST and sphinx , just because doconce is python 2.7. I strongly believe that you will get more contributors and users , if it is running on python 3.4 and python 2.7 simultaneously. if simultaneous support of py 2.7 and py 3.4 is not possible for doconce, then the time has probably come to switch to python 3.4 fully |
It is not entirely trivial as preprocess is not ported to Python 3, and this is an essential module. There might be more, but the process stopped already when importing preprocess. However, I created a new branch, py3, and ran futurize stage1 and stage2 on the files. This automated procedure worked with very few manual adjustments. At least the files work under Python 2 (all tests pass) and compile under Python 3. |
If i port "preprocess" module such that it runs on python 3.4 and python 2.7 both; THEN will that encourage you to take up this python 3.4 porting of "doconce" in a prioritized defined time frame ?? In that case, i can take up the porting of "preprocess" such that it runs on python 3.4 and python 2.7 simultaneously ? |
Preprocess was easy to port, Publish a bit harder. The process with doconce has stalled since with future (or six) \u is not tolerated in raw strings, see http://matplotlib.org/devel/portable_code.html. There are large portions of text generated with e.g. "\use..." for latex, and all backslashes seem to require a double . This makes long latex code hard to read and also maintain - and to port. We need a smarter way of tackling \u in raw strings with future/six before proceeding. |
how does "sphinx backend for Latex" does it. Sphinx-latex backend must be dealing with the same task, the same approach may be relevant here too |
I have been looking more closely into these issues. The Sphinx authors seem to have manually translated the code to a common Python 2/3 version using a minimum of functionality from the six package. In that way, strings in Python 2 are str objects (byte strings) and file objects work with such strings. The problem with doconce is that I used the There are three solutions. The first is to drop raw strings and use double backslashes. This requires quite some manual work and lower the readability of the latex translation substantially. A second solution is to replace It would be good to switch to a common Python 2/3 code base now, but I have to think more about the |
Though you have only \u issue left to think about, but still for the discussion-completion sake, i am posting here that for "all the other issues of python2 and python3 compatibility from the same code base" :- additionally, probably these will link will be also of some use to you : |
Thanks, this is really helpful! |
@KGHustad does it work with Python 3 already? |
Yes |
Many python libraries run on python 2.7 and python 3.4.
Especially one can use single file library of "six" ( see https://pypi.python.org/pypi/six ), which is compatibility library between python 2 and python 3). For example, mako templates runs upon starting from python 2.6 till python 3.4 - all simultaneously
So port doconce such that it runs on python 2.7 and python 3.4 both.
reference: my own comment on issue #25
The text was updated successfully, but these errors were encountered: