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

Run futurize --stage1 #2224

Closed

Conversation

@yegortimoshenko
Copy link
Contributor

commented Jul 10, 2019

futurize produces code that is compatible between Python 2 and 3. --stage1 leverages __future__ without requiring any external deps. See: http://python-future.org/automatic_conversion.html

To reproduce the exact same tree, one can run:

pip3 install future
echo > mailpile/tests/test_mail_generator.py
futurize --stage1 -nw .
git checkout -- mailpile/tests/test_mail_generator.py

This skips mailpile/tests/test_mail_generator.py for two reasons: first, it contains a non-UTF8 compliant symbol (by design), second, this file is already Python 3 compatible.

Want to keep these changes as reviewable as possible. I'll send a few more patches (rfc822 -> email, syntax fixes for Python 3 that futurize didn't pick up) next.

@yegortimoshenko

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

For the record, I've tested this changeset locally against my own Mailpile installation, specifically: sending/receiving messages, encryption, search.

@BjarniRunar

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

This relates to #160. Thanks for doing this. ❤️

@BjarniRunar

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

This is mostly merged in my local tree, will test a bit and explore before pushing to master. One thing I had to fix (so don't go redoing it) is the use of print() in doctests, looks like futurize overlooked those.

@yegortimoshenko

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

Thanks! Great.

I'll be sending rfc822 -> email patchset next, it's so small it shouldn't conflict with anything.

@BjarniRunar

This comment has been minimized.

Copy link
Member

commented Jul 19, 2019

This is merged, but I guess my rebasing changed enough things that Github didn't recognize it as such. Thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.