__init__.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import sys
  2. from lib2to3 import refactor
  3. # The original set of these fixes comes from lib3to2 (https://bitbucket.org/amentajo/lib3to2):
  4. fix_names = set([
  5. 'libpasteurize.fixes.fix_add_all__future__imports', # from __future__ import absolute_import etc. on separate lines
  6. 'libpasteurize.fixes.fix_add_future_standard_library_import', # we force adding this import for now, even if it doesn't seem necessary to the fix_future_standard_library fixer, for ease of testing
  7. # 'libfuturize.fixes.fix_order___future__imports', # consolidates to a single line to simplify testing -- UNFINISHED
  8. 'libpasteurize.fixes.fix_future_builtins', # adds "from future.builtins import *"
  9. 'libfuturize.fixes.fix_future_standard_library', # adds "from future import standard_library"
  10. 'libpasteurize.fixes.fix_annotations',
  11. # 'libpasteurize.fixes.fix_bitlength', # ints have this in Py2.7
  12. # 'libpasteurize.fixes.fix_bool', # need a decorator or Mixin
  13. # 'libpasteurize.fixes.fix_bytes', # leave bytes as bytes
  14. # 'libpasteurize.fixes.fix_classdecorator', # available in
  15. # Py2.6+
  16. # 'libpasteurize.fixes.fix_collections', hmmm ...
  17. # 'libpasteurize.fixes.fix_dctsetcomp', # avail in Py27
  18. 'libpasteurize.fixes.fix_division', # yes
  19. # 'libpasteurize.fixes.fix_except', # avail in Py2.6+
  20. # 'libpasteurize.fixes.fix_features', # ?
  21. 'libpasteurize.fixes.fix_fullargspec',
  22. # 'libpasteurize.fixes.fix_funcattrs',
  23. 'libpasteurize.fixes.fix_getcwd',
  24. 'libpasteurize.fixes.fix_imports', # adds "from future import standard_library"
  25. 'libpasteurize.fixes.fix_imports2',
  26. # 'libpasteurize.fixes.fix_input',
  27. # 'libpasteurize.fixes.fix_int',
  28. # 'libpasteurize.fixes.fix_intern',
  29. # 'libpasteurize.fixes.fix_itertools',
  30. 'libpasteurize.fixes.fix_kwargs', # yes, we want this
  31. # 'libpasteurize.fixes.fix_memoryview',
  32. # 'libpasteurize.fixes.fix_metaclass', # write a custom handler for
  33. # this
  34. # 'libpasteurize.fixes.fix_methodattrs', # __func__ and __self__ seem to be defined on Py2.7 already
  35. 'libpasteurize.fixes.fix_newstyle', # yes, we want this: explicit inheritance from object. Without new-style classes in Py2, super() will break etc.
  36. # 'libpasteurize.fixes.fix_next', # use a decorator for this
  37. # 'libpasteurize.fixes.fix_numliterals', # prob not
  38. # 'libpasteurize.fixes.fix_open', # huh?
  39. # 'libpasteurize.fixes.fix_print', # no way
  40. 'libpasteurize.fixes.fix_printfunction', # adds __future__ import print_function
  41. # 'libpasteurize.fixes.fix_raise_', # TODO: get this working!
  42. # 'libpasteurize.fixes.fix_range', # nope
  43. # 'libpasteurize.fixes.fix_reduce',
  44. # 'libpasteurize.fixes.fix_setliteral',
  45. # 'libpasteurize.fixes.fix_str',
  46. # 'libpasteurize.fixes.fix_super', # maybe, if our magic super() isn't robust enough
  47. 'libpasteurize.fixes.fix_throw', # yes, if Py3 supports it
  48. # 'libpasteurize.fixes.fix_unittest',
  49. 'libpasteurize.fixes.fix_unpacking', # yes, this is useful
  50. # 'libpasteurize.fixes.fix_with' # way out of date
  51. ])