-
Notifications
You must be signed in to change notification settings - Fork 48
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
Start preparing for Python 3 support #20
Conversation
a927cac
to
b177b85
Compare
Just FYI - I'm going to convert the file headers from comments to module-level docstrings, so that they will be respected by tools such as |
e80db1d
to
c4bb5ca
Compare
From running futurize, autoflake, isort, and a hand-rolled header fixing script.
Hi @jsn1993 - just as a process issue, the sequence of porting steps is pretty important to get Python 3 working without breaking Python 2. Basically, we need to:
|
Oh ok. Sorry about it. I thought it’s just a PR that someone should work on ... Thanks for reminding me of the order of the process!
… On May 2, 2019, at 22:41, Zac Hatfield-Dodds ***@***.***> wrote:
Hi @jsn1993 - just as a process issue, the sequence of porting steps is pretty important to get Python 3 working without breaking Python 2. Basically, we need to:
Merge this PR
Merge @ptpan's translation passes (possibly before this PR, if it's easier for him)
Finally, I'll come back and implement #22 and #23 in that order.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
No problem! I'm just waiting for Peitian's translation pull requests - this could be merged right now, but might make it much harder for him so I want to keep the option of merging those first. |
Let's get this pull request merged first. I will be mainly focusing on my course project next week so merging the translation pass probably has to wait after the next week... |
Awesome - is there anything else that needs to happen before I hit merge? |
FYI I did a push to revert the mis-commit from last night. I think this PR is ready to merge now. |
Start preparing for Python 3 support
This pull request uses
futurize
to ensure, and enforce in CI, that the codebase is syntactically valid on Python 3 as well as Python 2. This includes requiring use ofprint
as a function (not statement), and absolute imports.The implementation consists of updating some configuration in
.travis.yml
andsetup.py
, then running the tool and a few hand-fixes (a large diff), so I suggest reviewing the two commits separately.Because this changes from relative to absolute imports for Python 3 compatibility, I have made the other import-related changes at the same time. That's replacing comment headers with module docstrings (so tools understand they should be kept at the top of the file), removing unused imports with
autoflake
, and grouping and sorting imports withisort
.