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

Py2to3: Futurize stage 2 #406

Closed
inferno-chromium opened this issue Apr 23, 2019 · 7 comments
Closed

Py2to3: Futurize stage 2 #406

inferno-chromium opened this issue Apr 23, 2019 · 7 comments
Assignees

Comments

@inferno-chromium
Copy link
Collaborator

As part of Python 3 migration (#183)

git ls-files "*.py" | xargs futurize -w -n --stage2

obviously not as simple. need to be done in steps, and str and unicode fixes are the more tricky ones.

@inferno-chromium
Copy link
Collaborator Author

Need to think about these

src/local/butler/generate_datastore_models.py:  if py_type == long:
src/python/platforms/android/device.py:  if isinstance(value, long):

@inferno-chromium
Copy link
Collaborator Author

inferno-chromium commented Apr 26, 2019

Remaining ones, probably for Q3 and need to do str-unicode ones more carefully.

libfuturize.fixes.fix_unicode_keep_u
libfuturize.fixes.fix_future_standard_library_urllib (maybe start using requests, careful on exception handling)
libfuturize.fixes.fix_future_standard_library
libfuturize.fixes.fix_object
libfuturize.fixes.fix_basestring
libfuturize.fixes.fix_future_builtins

inferno-chromium added a commit that referenced this issue Apr 26, 2019
inferno-chromium added a commit that referenced this issue May 3, 2019
This includes
libfuturize.fixes.fix_future_standard_library_urllib
@inferno-chromium
Copy link
Collaborator Author

inferno-chromium commented May 3, 2019

Remaining (in libfuturize.fixes.fix_object, didn't do ndb_patcher since it is going away):

libfuturize.fixes.fix_unicode_keep_u
libfuturize.fixes.fix_future_standard_library
libfuturize.fixes.fix_basestring
libfuturize.fixes.fix_future_builtins

@oliverchang
Copy link
Collaborator

i'll tackle the unicode/str conversion

@oliverchang oliverchang self-assigned this May 20, 2019
oliverchang added a commit that referenced this issue May 21, 2019
Apply libfuturize.fixes.fix_future_standard_library and
libfuturize.fixes.fix_basestring.
oliverchang added a commit that referenced this issue May 21, 2019
Apply libfuturize.fixes.fix_future_standard_library and
libfuturize.fixes.fix_basestring.
oliverchang added a commit that referenced this issue May 21, 2019
oliverchang added a commit that referenced this issue May 21, 2019
@inferno-chromium
Copy link
Collaborator Author

For future, need to careful of any migration change in docker/ dir, example breakage due to 6d9f9e7#diff-f1db2c4f1d1b92aef6e74abff3119154 (my bad :() since we don't have future lib during start_host.py time. also got noticed when we updated host image.

oliverchang added a commit that referenced this issue May 28, 2019
oliverchang added a commit that referenced this issue May 29, 2019
* Reland "py2-3: more stage2 fixes (#406). (#472)" (#476)"

This reverts commit 80dac9a.
@inferno-chromium
Copy link
Collaborator Author

Just for tracking, we include everything now except libfuturize.fixes.fix_unicode_keep_u and libfuturize.fixes.fix_future_builtins (these need more work, will come later). minor exclusion is ndb_patcher which will go away soon.

To replicate / reapply fixes, do
git ls-files "*.py" | xargs futurize -w -n --stage2 -x libfuturize.fixes.fix_unicode_keep_u -x libfuturize.fixes.fix_future_builtins

@oliverchang
Copy link
Collaborator

All the futurize fixes were completed.

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

2 participants