This is an archive of the discontinued Mercurial Phabricator instance.

hgdemandimport: vendor CPython 3.7 tokenizer modules
AbandonedPublic

Authored by indygreg on Oct 13 2018, 3:28 AM.

Details

Reviewers
baymax
Group Reviewers
hg-reviewers
Summary

I have an evil plan to leverage the Python 3 tokenizer on Python 2.7.

The added files are Lib/token.py and Lib/tokenize.py from cpython's
Git repository at commit d4ed8809ddfaa23fe5edf2987c03afc32f5576c0. This
commit corresponds to the current development tip of the 3.7 branch.
The only commit since the 3.7.0 tag is
ab75d9e4244ee24bc96ea9d52362899e3bf365a2, which appears to contain a minor
fix to make the Python code more consistent with the C implementation.

The files are added without modifications. Future commits will tidy
things up a bit.

Because the files are third party, I've added them to static analysis
exclusion lists.

test-check-py3-compat.t and test-check-module-imports.t currently fail.
I'll deal with that in a subsequent commit.

  1. no-check-commit style violations galore

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Oct 13 2018, 3:28 AM
baymax requested changes to this revision.Jan 24 2020, 12:32 PM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.

:baymax:need-review-idle:

This revision now requires changes to proceed.Jan 24 2020, 12:32 PM
indygreg abandoned this revision.Jan 24 2020, 11:50 PM

I submitted this series as a PoC. We likely won't move ahead with it. Although if we want to pursue prolonged Python 2.7 support, this series would likely make it easier...

We can always resurrect it if we want.