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

Make hocr-tools fit for Python 3 #37

Closed
kba opened this issue Aug 24, 2016 · 6 comments
Closed

Make hocr-tools fit for Python 3 #37

kba opened this issue Aug 24, 2016 · 6 comments

Comments

@kba
Copy link
Contributor

kba commented Aug 24, 2016

We should consider making the tools ready for Python 3. Not so much because 2.7 is going away soon (it will be officially developed until 2020) but because all the problems 2to3 reports are easily fixable, e.g. throwing strings is bad practice in all versions.

The changes to the standard libaries (e.g. cStringIO is now io.StringIO) make it tedious to use the same code for both versions (and it's generally not recommended). Instead, I propose that we fix the code problems 2to3 reports and ensure (by testing in CI) that the code can be automatically ported to Python 3 and run the tests. At some point in the future, we can then just run 2to3 for good.

@kba kba mentioned this issue Aug 30, 2016
@kba
Copy link
Contributor Author

kba commented Sep 1, 2016

Was mostly implemented by #46, only step left is converting print statements.

@amitdo
Copy link
Contributor

amitdo commented Sep 4, 2016

The changes to the standard libaries ... make it tedious to use the same code for both versions (and it's generally not recommended). Instead, I propose that we fix the code problems 2to3 reports and ensure (by testing in CI) that the code can be automatically ported to Python 3 and run the tests. At some point in the future, we can then just run 2to3 for good.

@kba, @zuphilip, FYI
Actually, the recommended way is to use one shared codebase. This is reflected in the official docs: https://docs.python.org/3/howto/pyporting.html

I'm not suggesting you to change anything. It's just a note...

@zuphilip zuphilip mentioned this issue Sep 17, 2016
@kba
Copy link
Contributor Author

kba commented Sep 17, 2016

We could really just do the 2to3 print conversions, it won't break 2.7 and it will work out-of-the-box on systems with newer default python, like Arch Linux.

@zuphilip
Copy link
Collaborator

Cf. UB-Mannheim@e5fbb83 . But I guess we should also update then the travis tests, because the conversion there is not anymore needed?

@zuphilip
Copy link
Collaborator

Closed in #73

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

3 participants