pyflyby 1.9.2__tar.gz → 1.9.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyflyby might be problematic. Click here for more details.

Files changed (149) hide show
  1. {pyflyby-1.9.2/lib/python/pyflyby.egg-info → pyflyby-1.9.3}/PKG-INFO +1 -1
  2. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_comms.py +2 -3
  3. {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_flags.py +1 -1
  4. {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_importclns.py +1 -2
  5. {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_importdb.py +1 -2
  6. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_interactive.py +6 -4
  7. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_livepatch.py +1 -1
  8. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_log.py +1 -1
  9. {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_version.py +1 -1
  10. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/tidy-imports +5 -7
  11. {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/std.py +1 -1
  12. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_comms.py +2 -3
  13. {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_flags.py +1 -1
  14. {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_importclns.py +1 -2
  15. {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_importdb.py +1 -2
  16. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_interactive.py +6 -4
  17. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_livepatch.py +1 -1
  18. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_log.py +1 -1
  19. {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_version.py +1 -1
  20. {pyflyby-1.9.2 → pyflyby-1.9.3/lib/python/pyflyby.egg-info}/PKG-INFO +1 -1
  21. {pyflyby-1.9.2 → pyflyby-1.9.3}/.pyflyby +0 -0
  22. {pyflyby-1.9.2 → pyflyby-1.9.3}/LICENSE.txt +0 -0
  23. {pyflyby-1.9.2 → pyflyby-1.9.3}/MANIFEST.in +0 -0
  24. {pyflyby-1.9.2 → pyflyby-1.9.3}/README.rst +0 -0
  25. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/autoipython +0 -0
  26. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/autopython +0 -0
  27. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/collect-exports +0 -0
  28. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/collect-imports +0 -0
  29. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/create-imports +0 -0
  30. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/find-import +0 -0
  31. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/list-bad-xrefs +0 -0
  32. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/prune-broken-imports +0 -0
  33. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/py +0 -0
  34. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/__init__.py +0 -0
  35. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/__main__.py +0 -0
  36. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_autoimp.py +0 -0
  37. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_cmdline.py +0 -0
  38. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_dbg.py +0 -0
  39. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_docxref.py +0 -0
  40. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_file.py +0 -0
  41. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_format.py +0 -0
  42. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_idents.py +0 -0
  43. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_imports2s.py +0 -0
  44. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_importstmt.py +0 -0
  45. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_modules.py +0 -0
  46. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_parse.py +0 -0
  47. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_py.py +0 -0
  48. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_util.py +0 -0
  49. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/autoimport.py +0 -0
  50. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/importdb.py +0 -0
  51. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby-diff +0 -0
  52. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/reformat-imports +0 -0
  53. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/replace-star-imports +0 -0
  54. {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/transform-imports +0 -0
  55. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/LICENSE.txt +0 -0
  56. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/Makefile +0 -0
  57. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/TODO.txt +0 -0
  58. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/__init__.py +0 -0
  59. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/api.rst +0 -0
  60. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/autoimp.rst +0 -0
  61. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/cmdline.rst +0 -0
  62. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/comms.rst +0 -0
  63. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/dbg.rst +0 -0
  64. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/file.rst +0 -0
  65. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/flags.rst +0 -0
  66. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/format.rst +0 -0
  67. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/idents.rst +0 -0
  68. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/importclns.rst +0 -0
  69. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/importdb.rst +0 -0
  70. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/imports2s.rst +0 -0
  71. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/importstmt.rst +0 -0
  72. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/interactive.rst +0 -0
  73. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/livepatch.rst +0 -0
  74. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/log.rst +0 -0
  75. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/modules.rst +0 -0
  76. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/parse.rst +0 -0
  77. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/py.rst +0 -0
  78. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/util.rst +0 -0
  79. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/autoipython.rst +0 -0
  80. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/cli.rst +0 -0
  81. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/collect_exports.rst +0 -0
  82. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/collect_imports.rst +0 -0
  83. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/find_import.rst +0 -0
  84. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/prune_broken_imports.rst +0 -0
  85. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/py.rst +0 -0
  86. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/pyflyby_diff.rst +0 -0
  87. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/reformat_imports.rst +0 -0
  88. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/replace_star_imports.rst +0 -0
  89. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/tidy_imports.rst +0 -0
  90. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/transform_imports.rst +0 -0
  91. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/conf.py +0 -0
  92. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/index.rst +0 -0
  93. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/make.bat +0 -0
  94. {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/testing.txt +0 -0
  95. {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/canonical.py +0 -0
  96. {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/common.py +0 -0
  97. {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/forget.py +0 -0
  98. {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/mandatory.py +0 -0
  99. {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/numpy.py +0 -0
  100. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/emacs/pyflyby.el +0 -0
  101. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/__init__.py +0 -0
  102. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/__main__.py +0 -0
  103. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_autoimp.py +0 -0
  104. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_cmdline.py +0 -0
  105. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_dbg.py +0 -0
  106. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_docxref.py +0 -0
  107. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_file.py +0 -0
  108. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_format.py +0 -0
  109. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_idents.py +0 -0
  110. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_imports2s.py +0 -0
  111. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_importstmt.py +0 -0
  112. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_modules.py +0 -0
  113. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_parse.py +0 -0
  114. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_py.py +0 -0
  115. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_util.py +0 -0
  116. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/autoimport.py +0 -0
  117. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/importdb.py +0 -0
  118. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/SOURCES.txt +0 -0
  119. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/dependency_links.txt +0 -0
  120. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/entry_points.txt +0 -0
  121. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/requires.txt +0 -0
  122. {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/top_level.txt +0 -0
  123. {pyflyby-1.9.2 → pyflyby-1.9.3}/libexec/pyflyby/colordiff +0 -0
  124. {pyflyby-1.9.2 → pyflyby-1.9.3}/libexec/pyflyby/diff-colorize +0 -0
  125. {pyflyby-1.9.2 → pyflyby-1.9.3}/setup.cfg +0 -0
  126. {pyflyby-1.9.2 → pyflyby-1.9.3}/setup.py +0 -0
  127. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/__init__.py +0 -0
  128. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_0testconfig.py +0 -0
  129. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_autoimp.py +0 -0
  130. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_cmdline.py +0 -0
  131. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_docxref.py +0 -0
  132. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_file.py +0 -0
  133. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_flags.py +0 -0
  134. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_format.py +0 -0
  135. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_idents.py +0 -0
  136. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_importclns.py +0 -0
  137. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_importdb.py +0 -0
  138. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_imports2s.py +0 -0
  139. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_importstmt.py +0 -0
  140. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_interactive.py +0 -0
  141. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_jupyterlab_pyflyby.py +0 -0
  142. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_livepatch.py +0 -0
  143. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_modules.py +0 -0
  144. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_parse.py +0 -0
  145. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_py.py +0 -0
  146. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_util.py +0 -0
  147. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/tests_sorts.py +0 -0
  148. {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/xrefs.py +0 -0
  149. {pyflyby-1.9.2 → pyflyby-1.9.3}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyflyby
3
- Version: 1.9.2
3
+ Version: 1.9.3
4
4
  Summary: pyflyby - Python development productivity tools, in particular automatic import management
5
5
  Home-page: https://pypi.org/project/pyflyby/
6
6
  Author: Karl Chen
@@ -8,7 +8,6 @@ from pyflyby._imports2s import (SourceToSourceFileImportsTransformation,
8
8
  reformat_import_statements)
9
9
  from pyflyby._importstmt import Import
10
10
  from pyflyby._log import logger
11
- import six
12
11
 
13
12
  # These are comm targets that the frontend (lab/notebook) is expected to
14
13
  # open. At this point, we handle only missing imports and
@@ -67,7 +66,7 @@ def initialize_comms():
67
66
 
68
67
 
69
68
  def remove_comms():
70
- for target_name, comm in six.iteritems(comms):
69
+ for target_name, comm in comms.items():
71
70
  comm.close()
72
71
  logger.debug("Closing comm for " + target_name)
73
72
 
@@ -87,7 +86,7 @@ def send_comm_message(target_name, msg):
87
86
 
88
87
  def comm_close_handler(comm, message):
89
88
  comm_id = message["comm_id"]
90
- for target, comm in six.iterkeys(comms):
89
+ for target, comm in comms.keys():
91
90
  if comm.comm_id == comm_id:
92
91
  comms.pop(target)
93
92
 
@@ -7,7 +7,7 @@
7
7
  import __future__
8
8
  import ast
9
9
  import operator
10
- from six.moves import reduce
10
+ from functools import reduce
11
11
  import warnings
12
12
 
13
13
  from pyflyby._util import cached_attribute
@@ -6,7 +6,6 @@
6
6
 
7
7
  from collections import defaultdict
8
8
  from functools import total_ordering
9
- import six
10
9
 
11
10
  from pyflyby._flags import CompilerFlags
12
11
  from pyflyby._idents import dotted_prefixes, is_identifier
@@ -567,7 +566,7 @@ class ImportMap(object):
567
566
  return self._data.items()
568
567
 
569
568
  def iterkeys(self):
570
- return six.iterkeys(self._data)
569
+ return iter(self._data.keys())
571
570
 
572
571
  def keys(self):
573
572
  return self._data.keys()
@@ -7,7 +7,6 @@
7
7
  from collections import defaultdict
8
8
  import os
9
9
  import re
10
- import six
11
10
 
12
11
  from pyflyby._file import Filename, expand_py_files_from_args, UnsafeFilenameError
13
12
  from pyflyby._idents import dotted_prefixes
@@ -560,7 +559,7 @@ class ImportDB(object):
560
559
  for prefix in dotted_prefixes(imp.fullname)[:-1]:
561
560
  d[prefix].add(Import.from_parts(prefix, prefix))
562
561
  return dict( (k, tuple(sorted(v - set(self.forget_imports.imports))))
563
- for k, v in six.iteritems(d))
562
+ for k, v in d.items())
564
563
 
565
564
  def __repr__(self):
566
565
  printed = self.pretty_print()
@@ -5,16 +5,16 @@
5
5
 
6
6
 
7
7
  import ast
8
+ import builtins
8
9
  from contextlib import contextmanager
9
10
  import errno
10
11
  import inspect
11
12
  import os
13
+ import operator
12
14
  import re
13
15
  import subprocess
14
16
  import sys
15
17
 
16
- import six
17
- from six.moves import builtins
18
18
 
19
19
  from pyflyby._autoimp import (LoadSymbolError, ScopeStack, auto_eval,
20
20
  auto_import,
@@ -37,6 +37,8 @@ if False:
37
37
  __original__ = None # for pyflakes
38
38
 
39
39
 
40
+ get_method_self = operator.attrgetter('__self__')
41
+
40
42
  # TODO: also support arbitrary code (in the form of a lambda and/or
41
43
  # assignment) as new way to do "lazy" creations, e.g. foo = a.b.c(d.e+f.g())
42
44
 
@@ -2098,7 +2100,7 @@ class AutoImporter(object):
2098
2100
  # Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
2099
2101
  # 3.1, 3.2, 4.0.
2100
2102
  line_magics = ip.magics_manager.magics['line']
2101
- execmgr = six.get_method_self(line_magics['prun'])#.im_self
2103
+ execmgr = get_method_self(line_magics['prun'])#.im_self
2102
2104
  if hasattr(execmgr, "_run_with_profiler"):
2103
2105
  @self._advise(execmgr._run_with_profiler)
2104
2106
  def run_with_profiler_with_autoimport(code, opts, namespace):
@@ -2303,7 +2305,7 @@ class AutoImporter(object):
2303
2305
  # Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
2304
2306
  # 3.1, 3.2, 4.0, 5.8.
2305
2307
  line_magics = ip.magics_manager.magics['line']
2306
- execmgr = six.get_method_self(line_magics['debug'])
2308
+ execmgr = get_method_self(line_magics['debug'])
2307
2309
  if hasattr(execmgr, "_run_with_debugger"):
2308
2310
  @self._advise(execmgr._run_with_debugger)
2309
2311
  def run_with_debugger_with_autoimport(code, code_ns,
@@ -138,7 +138,7 @@ import sys
138
138
  import time
139
139
  import types
140
140
 
141
- from six.moves import reload_module
141
+ from importlib import reload as reload_module
142
142
 
143
143
  import inspect
144
144
  from pyflyby._log import logger
@@ -4,11 +4,11 @@
4
4
 
5
5
 
6
6
 
7
+ import builtins
7
8
  from contextlib import contextmanager
8
9
  import logging
9
10
  from logging import Handler, Logger
10
11
  import os
11
- from six.moves import builtins
12
12
  import sys
13
13
 
14
14
 
@@ -5,4 +5,4 @@
5
5
 
6
6
 
7
7
 
8
- __version__ = '1.9.2'
8
+ __version__ = '1.9.3'
@@ -27,7 +27,7 @@ from pyflyby._cmdline import hfmt, parse_args, process_actions
27
27
  from pyflyby._imports2s import (canonicalize_imports,
28
28
  fix_unused_and_missing_imports,
29
29
  replace_star_imports,
30
- transform_imports, sort_imports)
30
+ transform_imports)
31
31
 
32
32
  import toml
33
33
  TOML_AVAIL = True
@@ -156,13 +156,11 @@ def main():
156
156
  )
157
157
  # TODO: disable sorting until we figure out #287
158
158
  # https://github.com/deshaw/pyflyby/issues/287
159
- # sorted_imports = sort_imports(x)
160
- sorted_imports = x
159
+ # from pyflyby._imports2s import sort_imports
160
+ # x = sort_imports(x)
161
161
  if options.canonicalize:
162
- cannonical_imports = canonicalize_imports(sorted_imports, params=options.params)
163
- else:
164
- cannonical_imports = sort_imports
165
- return cannonical_imports
162
+ x = canonicalize_imports(x, params=options.params)
163
+ return x
166
164
  process_actions(args, options.actions, modify)
167
165
 
168
166
 
@@ -148,7 +148,7 @@ from six.moves import (builtins, cPickle, configparser,
148
148
  email_mime_image, email_mime_multipart,
149
149
  email_mime_text, http_client, map,
150
150
  queue, zip)
151
- from six.moves.urllib.parse import urlencode
151
+ from urllib.parse import urlencode
152
152
  from six.moves.urllib.request import urlopen
153
153
  import smtplib
154
154
  from smtplib import (SMTP, SMTPAuthenticationError,
@@ -8,7 +8,6 @@ from pyflyby._imports2s import (SourceToSourceFileImportsTransformation,
8
8
  reformat_import_statements)
9
9
  from pyflyby._importstmt import Import
10
10
  from pyflyby._log import logger
11
- import six
12
11
 
13
12
  # These are comm targets that the frontend (lab/notebook) is expected to
14
13
  # open. At this point, we handle only missing imports and
@@ -67,7 +66,7 @@ def initialize_comms():
67
66
 
68
67
 
69
68
  def remove_comms():
70
- for target_name, comm in six.iteritems(comms):
69
+ for target_name, comm in comms.items():
71
70
  comm.close()
72
71
  logger.debug("Closing comm for " + target_name)
73
72
 
@@ -87,7 +86,7 @@ def send_comm_message(target_name, msg):
87
86
 
88
87
  def comm_close_handler(comm, message):
89
88
  comm_id = message["comm_id"]
90
- for target, comm in six.iterkeys(comms):
89
+ for target, comm in comms.keys():
91
90
  if comm.comm_id == comm_id:
92
91
  comms.pop(target)
93
92
 
@@ -7,7 +7,7 @@
7
7
  import __future__
8
8
  import ast
9
9
  import operator
10
- from six.moves import reduce
10
+ from functools import reduce
11
11
  import warnings
12
12
 
13
13
  from pyflyby._util import cached_attribute
@@ -6,7 +6,6 @@
6
6
 
7
7
  from collections import defaultdict
8
8
  from functools import total_ordering
9
- import six
10
9
 
11
10
  from pyflyby._flags import CompilerFlags
12
11
  from pyflyby._idents import dotted_prefixes, is_identifier
@@ -567,7 +566,7 @@ class ImportMap(object):
567
566
  return self._data.items()
568
567
 
569
568
  def iterkeys(self):
570
- return six.iterkeys(self._data)
569
+ return iter(self._data.keys())
571
570
 
572
571
  def keys(self):
573
572
  return self._data.keys()
@@ -7,7 +7,6 @@
7
7
  from collections import defaultdict
8
8
  import os
9
9
  import re
10
- import six
11
10
 
12
11
  from pyflyby._file import Filename, expand_py_files_from_args, UnsafeFilenameError
13
12
  from pyflyby._idents import dotted_prefixes
@@ -560,7 +559,7 @@ class ImportDB(object):
560
559
  for prefix in dotted_prefixes(imp.fullname)[:-1]:
561
560
  d[prefix].add(Import.from_parts(prefix, prefix))
562
561
  return dict( (k, tuple(sorted(v - set(self.forget_imports.imports))))
563
- for k, v in six.iteritems(d))
562
+ for k, v in d.items())
564
563
 
565
564
  def __repr__(self):
566
565
  printed = self.pretty_print()
@@ -5,16 +5,16 @@
5
5
 
6
6
 
7
7
  import ast
8
+ import builtins
8
9
  from contextlib import contextmanager
9
10
  import errno
10
11
  import inspect
11
12
  import os
13
+ import operator
12
14
  import re
13
15
  import subprocess
14
16
  import sys
15
17
 
16
- import six
17
- from six.moves import builtins
18
18
 
19
19
  from pyflyby._autoimp import (LoadSymbolError, ScopeStack, auto_eval,
20
20
  auto_import,
@@ -37,6 +37,8 @@ if False:
37
37
  __original__ = None # for pyflakes
38
38
 
39
39
 
40
+ get_method_self = operator.attrgetter('__self__')
41
+
40
42
  # TODO: also support arbitrary code (in the form of a lambda and/or
41
43
  # assignment) as new way to do "lazy" creations, e.g. foo = a.b.c(d.e+f.g())
42
44
 
@@ -2098,7 +2100,7 @@ class AutoImporter(object):
2098
2100
  # Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
2099
2101
  # 3.1, 3.2, 4.0.
2100
2102
  line_magics = ip.magics_manager.magics['line']
2101
- execmgr = six.get_method_self(line_magics['prun'])#.im_self
2103
+ execmgr = get_method_self(line_magics['prun'])#.im_self
2102
2104
  if hasattr(execmgr, "_run_with_profiler"):
2103
2105
  @self._advise(execmgr._run_with_profiler)
2104
2106
  def run_with_profiler_with_autoimport(code, opts, namespace):
@@ -2303,7 +2305,7 @@ class AutoImporter(object):
2303
2305
  # Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
2304
2306
  # 3.1, 3.2, 4.0, 5.8.
2305
2307
  line_magics = ip.magics_manager.magics['line']
2306
- execmgr = six.get_method_self(line_magics['debug'])
2308
+ execmgr = get_method_self(line_magics['debug'])
2307
2309
  if hasattr(execmgr, "_run_with_debugger"):
2308
2310
  @self._advise(execmgr._run_with_debugger)
2309
2311
  def run_with_debugger_with_autoimport(code, code_ns,
@@ -138,7 +138,7 @@ import sys
138
138
  import time
139
139
  import types
140
140
 
141
- from six.moves import reload_module
141
+ from importlib import reload as reload_module
142
142
 
143
143
  import inspect
144
144
  from pyflyby._log import logger
@@ -4,11 +4,11 @@
4
4
 
5
5
 
6
6
 
7
+ import builtins
7
8
  from contextlib import contextmanager
8
9
  import logging
9
10
  from logging import Handler, Logger
10
11
  import os
11
- from six.moves import builtins
12
12
  import sys
13
13
 
14
14
 
@@ -5,4 +5,4 @@
5
5
 
6
6
 
7
7
 
8
- __version__ = '1.9.2'
8
+ __version__ = '1.9.3'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyflyby
3
- Version: 1.9.2
3
+ Version: 1.9.3
4
4
  Summary: pyflyby - Python development productivity tools, in particular automatic import management
5
5
  Home-page: https://pypi.org/project/pyflyby/
6
6
  Author: Karl Chen
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes