Make ADS Python 3.5x/3.6x compatible
See original GitHub issueCurrent branch: py2to3
Issue raised by @jcohenadad in issue #91 .
The first thing I think needs to be decided is if we want to make ADS compatible with both Python 2.7 and 3.5x/3.6x. The resources I found (below) seem to be contradicting themselves over which is preferred in the community. Dual compatibility is a bit messier to maintain in the long term; while it’s (relatively) simple to convert the code for dual compatibility, the problematic issue will then be that each dev on the future project will have to know all the little tricks needed for dual compatibility (see cheat sheet below), rather than using just Python 3’s strengths.
Most resources agree that the next step is to have comprehensive test coverage of the repo. I’ve already started working on this in branch unit_tests, which handles issue #76. I’ve also added a coveralls.io badge to the branch that gets evaluated in the Travis test, which currently asses the test coverage in that branch to be 15 % (only using the unit tests, not the integration test integrity_test.m
). Once we have a test coverage closer to 100% (most people agree online that exactly 100% might be nitpicky, so >80-90% is good to aim for), then it will be easier to determine if the code functions well after being converted for 3.5/3.6x or dual 2.7/3.x.
Resources:
- Porting Python 2 Code to Python 3
- Supporting Python 2 and 3 without 2to3 conversion
- This is somewhat of a badly titled article, because the first step they suggest is actually to do
2to3
conversion, and then debug the code until it runs in a Python 2.7 environment.
- This is somewhat of a badly titled article, because the first step they suggest is actually to do
- Cheat sheet for writing Python 2-3 compatible code
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Completely agree, Python 3 is the way to go, a lot of libraries are deprecating Python 2 in the following 1 or 2 years so it’s a good move.
In my opinion, we don’t need to have dual compatibility, we could just stick to Python 3. @perone what do you think?