Skip to content

Commit

Permalink
isort remove_imports generator_stop
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Jun 27, 2022
1 parent 88055b0 commit 97887c1
Show file tree
Hide file tree
Showing 59 changed files with 12 additions and 108 deletions.
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from __future__ import generator_stop

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
Expand Down
1 change: 0 additions & 1 deletion modernize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
A hack on top of fissix (lib2to3 fork) for modernizing code for hybrid codebases.
"""

from __future__ import generator_stop

__version__ = "0.9rc1.dev0"
2 changes: 0 additions & 2 deletions modernize/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

import sys

from .main import main
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

fissix_fix_names = {
"fissix.fixes.fix_apply",
"fissix.fixes.fix_except",
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_basestring.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util


Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_classic_division.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base, pytree
from fissix.pgen2 import token

Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_dict_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Fixer for iterkeys() -> six.iterkeys(), and similarly for iteritems and itervalues.
"""

from __future__ import generator_stop

# Local imports
from fissix import fixer_util, pytree
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base
from fissix.fixer_util import Name

Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_filter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.

from __future__ import generator_stop

from fissix import fixer_util
from fissix.fixes import fix_filter
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_import.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix.fixer_util import syms
from fissix.fixes import fix_import

Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_imports_six.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix.fixes import fix_imports


Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_input_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013, 2014 Python Software Foundation. All rights reserved.

from __future__ import generator_stop

from fissix import fixer_base, fixer_util
from fissix.fixer_util import Call, Name
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_int_long_tuple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util


Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_itertools_imports_six.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
""" Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """

from __future__ import generator_stop

# Local imports
from fissix import fixer_base, fixer_util
Expand Down
4 changes: 2 additions & 2 deletions modernize/fixes/fix_itertools_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
If itertools is imported as something else (ie: import itertools as it;
it.izip(spam, eggs)) method calls will not get fixed.
"""


# This is a derived work of Lib/lib2to3/fixes/fix_itertools_import.py. That file
# is under the copyright of the Python Software Foundation and licensed
# under the Python Software Foundation License 2.
Expand All @@ -13,8 +15,6 @@
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013 Python Software Foundation. All rights reserved.
from __future__ import generator_stop

# Local imports
from fissix import fixer_base, fixer_util
from fissix.fixer_util import Name
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_map.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.

from __future__ import generator_stop

from fissix import fixer_util
from fissix.fixes import fix_map
Expand Down
4 changes: 2 additions & 2 deletions modernize/fixes/fix_metaclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
This fixer also tries very hard to keep original indenting and spacing
in all those corner cases.
"""


# This is a derived work of Lib/lib2to3/fixes/fix_metaclass.py. That file
# is under the copyright of the Python Software Foundation and licensed
# under the Python Software Foundation License 2.
Expand All @@ -22,8 +24,6 @@
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013 Python Software Foundation. All rights reserved.
from __future__ import generator_stop

# Local imports
from fissix import fixer_base, fixer_util
from fissix.fixer_util import Call, Comma, Leaf, Name, Node, syms
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_next.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Fixer for it.next() -> next(it)"""

from __future__ import generator_stop

# Local imports
from fissix import fixer_base
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_open.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util


Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_print.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix.fixes import fix_print

from .. import utils
Expand Down
4 changes: 2 additions & 2 deletions modernize/fixes/fix_raise.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
any client code would have to be changed as well, we don't automate
this.
"""
# Author: Collin Winter, Armin Ronacher
from __future__ import generator_stop


# Author: Collin Winter, Armin Ronacher
from fissix.fixes import fix_raise


Expand Down
4 changes: 2 additions & 2 deletions modernize/fixes/fix_raise_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
raise E, V, T -> six.reraise(E, V, T)
"""
# Author : Markus Unterwaditzer
from __future__ import generator_stop


# Author : Markus Unterwaditzer
# Local imports
from fissix import fixer_base, fixer_util
from fissix.fixer_util import Call, Comma, Name
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_unichr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util
from fissix.fixer_util import is_probably_builtin

Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_unicode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

import re

from fissix import fixer_base, fixer_util
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_unicode_future.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix.fixes import fix_unicode

from .. import utils
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_unicode_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util


Expand Down
4 changes: 2 additions & 2 deletions modernize/fixes/fix_urllib_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
This is a copy of Lib/lib2to3/fixes/fix_urllib.py, but modified to point to the
six.moves locations for new libraries instead of the Python 3 locations.
"""


# This is a derived work of Lib/lib2to3/fixes/fix_urllib.py. That file
# is under the copyright of the Python Software Foundation and licensed
# under the Python Software Foundation License 2.
Expand All @@ -10,8 +12,6 @@
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013 Python Software Foundation. All rights reserved.
from __future__ import generator_stop

from fissix.fixer_util import (
Comma,
FromImport,
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_xrange_six.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.

from __future__ import generator_stop

from fissix import fixer_base, fixer_util
from fissix.fixes import fix_xrange
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_zip.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.

from __future__ import generator_stop

from fissix import fixer_util
from fissix.fixes import fix_zip
Expand Down
1 change: 0 additions & 1 deletion modernize/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
|_|_|_\\___/\\__,_\\___|_| |_||_|_/__\\___|\
"""

from __future__ import generator_stop

import logging
import optparse
Expand Down
2 changes: 0 additions & 2 deletions modernize/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from fissix import fixer_util
from fissix.pgen2 import token
from fissix.pygram import python_symbols as syms
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
]
description-file = "README.rst"
requires = ["fissix"]
requires-python = "~=3.6"
requires-python = "~=3.7"

[tool.flit.metadata.requires-extra]
docs = [
Expand All @@ -43,7 +43,7 @@ python-modernize = "modernize.main:main"

[tool.isort]
profile = "black"
add_imports=["from __future__ import generator_stop"]
remove_imports=["from __future__ import generator_stop"]

[tool.pytest.ini_options]
addopts = [
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_basestring.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

BASESTRING = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_classic_division.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

CLASSIC_DIVISION = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_dict_six.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

TYPES = "keys", "items", "values"
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

FILE_CALL = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_filter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

FILTER_CALL = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_import.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

NO_IMPORTS = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_imports_six.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

import sys
import unittest

Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_input_six.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

INPUT = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_int_long_tuple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

INT_LONG_ISINSTANCE = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_itertools_imports_six.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

IZIP_AND_CHAIN_REFERENCE = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

MAP_1_ARG = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_metaclass.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

METACLASS_NO_BASE = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_next.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

NEXT_METHOD = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_open.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

OPEN = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_print.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

PRINT_BARE = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_raise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

RAISE = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_unichr_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

UNICHR_METHOD_REF = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_unicode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

UNICODE_LITERALS = """\
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_unicode_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

UNICODE_TYPE_REF = (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fix_urllib_six.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import generator_stop

from utils import check_on_input

URLLIB_MODULE_REFERENCE = (
Expand Down
Loading

0 comments on commit 97887c1

Please sign in to comment.