Skip to content

Commit

Permalink
remove __future__ imports
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed May 8, 2023
1 parent ccdcd42 commit 7310387
Show file tree
Hide file tree
Showing 59 changed files with 42 additions and 107 deletions.
2 changes: 0 additions & 2 deletions bin/autoipython
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Or, you can manually add 'pyflyby.enable_auto_importer()' wherever you prefer.
# Copyright (C) 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement
from __future__ import print_function

import sys

Expand Down
2 changes: 0 additions & 2 deletions bin/collect-exports
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Print the result to stdout.
# License: MIT http://opensource.org/licenses/MIT


from __future__ import absolute_import, division, with_statement
from __future__ import print_function

import sys

Expand Down
1 change: 0 additions & 1 deletion bin/collect-imports
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ block of import statements. Print the result to stdout.
# Copyright (C) 2011, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement

import re
import sys
Expand Down
2 changes: 0 additions & 2 deletions bin/find-import
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Prints how to import given name(s).
# Copyright (C) 2011, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement
from __future__ import print_function

from pyflyby._cmdline import parse_args, syntax
from pyflyby._importdb import ImportDB
Expand Down
2 changes: 0 additions & 2 deletions bin/list-bad-xrefs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Similar to running C{epydoc -v}, but:
# Copyright (C) 2011, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement
from __future__ import print_function

from pyflyby._cmdline import parse_args, syntax
from pyflyby._docxref import find_bad_doc_cross_references
Expand Down
1 change: 0 additions & 1 deletion bin/prune-broken-imports
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Only top-level import statements are touched.
# Copyright (C) 2012, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement

from pyflyby._cmdline import parse_args, process_actions
from pyflyby._imports2s import remove_broken_imports
Expand Down
1 change: 0 additions & 1 deletion bin/py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This file is only used when pyflyby is not installed by setup.py.
When installed by setup.py, we use the pkg_resources entry_point mechanism.
"""

from __future__ import absolute_import, division, with_statement

# TODO: generate this script and others from a template.

Expand Down
1 change: 0 additions & 1 deletion bin/reformat-imports
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Reformats the top-level 'import' blocks within the python module/script.
# Copyright (C) 2011, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement

from pyflyby._cmdline import parse_args, process_actions
from pyflyby._imports2s import reformat_import_statements
Expand Down
1 change: 0 additions & 1 deletion bin/replace-star-imports
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Only top-level import statements are touched.
# Copyright (C) 2012, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement

from pyflyby._cmdline import parse_args, process_actions
from pyflyby._imports2s import replace_star_imports
Expand Down
1 change: 0 additions & 1 deletion bin/tidy-imports
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Only top-level import statements are touched.
# Copyright (C) 2011, 2012, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import print_function, absolute_import, division, with_statement

from distutils.spawn import find_executable
import subprocess
Expand Down
1 change: 0 additions & 1 deletion bin/transform-imports
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ stdin is not a tty, read from stdin and write to stdout.
# Copyright (C) 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import absolute_import, division, with_statement

from pyflyby._cmdline import hfmt, parse_args, process_actions
from pyflyby._imports2s import transform_imports
Expand Down
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@


from __future__ import absolute_import, division, with_statement

import os
import re
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from pyflyby._autoimp import (auto_eval, auto_import,
find_missing_imports)
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2014, 2015 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


if __name__ == "__main__":
from pyflyby._py import py_main
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_autoimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018, 2019 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import ast
import contextlib
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import optparse
import os
Expand Down
1 change: 0 additions & 1 deletion lib/python/pyflyby/_comms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function

from pyflyby._log import logger
from pyflyby._imports2s import SourceToSourceFileImportsTransformation
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_dbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from contextlib import contextmanager
import errno
Expand Down
2 changes: 0 additions & 2 deletions lib/python/pyflyby/_docxref.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
# from, out of or in connection with the software or the use or other
# dealings in the software.

from __future__ import (absolute_import, division, print_function,
with_statement)

import re
import six
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from functools import total_ordering
import io
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import __future__
import ast
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import six

Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_idents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from functools import total_ordering
from keyword import kwlist
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_importclns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from collections import defaultdict
from functools import total_ordering
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_importdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from collections import defaultdict
import os
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_imports2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011-2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from pyflyby._autoimp import scan_for_import_issues
from pyflyby._file import FileText, Filename
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_importstmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import ast
from collections import namedtuple
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import ast
from contextlib import contextmanager
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_livepatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def __livepatch__(self, old, do_livepatch):
"""

from __future__ import (absolute_import, division, print_function,
with_statement)


import ast
import os
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from contextlib import contextmanager
import logging
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from functools import total_ordering
import os
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


import ast
from collections import namedtuple
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@
"""

from __future__ import (absolute_import, division, print_function,
with_statement)


from functools import total_ordering

Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT

from __future__ import (absolute_import, division, print_function,
with_statement)


from contextlib import contextmanager
import inspect
Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# License for THIS FILE ONLY: CC0 Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/

from __future__ import (absolute_import, division, print_function,
with_statement)


__version__ = '1.8.4'
3 changes: 1 addition & 2 deletions lib/python/pyflyby/autoimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# import pyflyby
# pyflyby.enable_auto_importer()

from __future__ import (absolute_import, division, print_function,
with_statement)


from pyflyby._interactive import enable_auto_importer

Expand Down
3 changes: 1 addition & 2 deletions lib/python/pyflyby/importdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

# Deprecated stub for backwards compatibility.

from __future__ import (absolute_import, division, print_function,
with_statement)


from pyflyby._importdb import ImportDB

Expand Down
1 change: 0 additions & 1 deletion libexec/pyflyby/diff-colorize
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import absolute_import, division, with_statement

import fileinput
import os
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
# License for THIS FILE ONLY: CC0 Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/

from __future__ import (absolute_import, division, print_function,
with_statement)


import glob
import os
Expand Down
1 change: 0 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from __future__ import absolute_import, division, print_function

3 changes: 1 addition & 2 deletions tests/test_0testconfig.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

# Some self tests to check that our test setup is pointing to wrong paths etc.

from __future__ import (absolute_import, division, print_function,
with_statement)


import os
import pytest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_autoimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# License for THIS FILE ONLY: CC0 Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/

from __future__ import (absolute_import, division, print_function,
with_statement)


import ast
import os
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# License for THIS FILE ONLY: CC0 Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/

from __future__ import (absolute_import, division, print_function,
with_statement)


from io import BytesIO
import os
Expand Down
Loading

0 comments on commit 7310387

Please sign in to comment.