From a44b9711ad0e1874c12bdcb3abd6584827986ef9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 1 Mar 2022 16:20:02 +0100 Subject: [PATCH 01/13] GitHub Action: Add Python 3.10 and remove 3.6 https://devguide.python.org/#status-of-python-branches vs. https://devguide.python.org/devcycle/#end-of-life-branches --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 668db06..b5c01d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.7", "3.8", "3.9", "3.10"] os: [macOS-latest, ubuntu-latest, windows-latest] steps: @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v2 - name: Set Up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} From f2373cc0dcf084acb2c0a8bb6296e1975a6aca91 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 1 Mar 2022 16:21:39 +0100 Subject: [PATCH 02/13] Run tox on py{37,38,39,310},lint --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 03afe76..cf5877a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,10 +13,10 @@ classifiers = [ "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ] description-file = "README.rst" requires = ["fissix"] @@ -79,7 +79,7 @@ legacy_tox_ini = """ [tox] envlist = - py{36,37,38,39},lint + py{37,38,39,310},lint minversion=3.20.1 isolated_build=true requires= From 494c97c7287bf0f79778a47b9bbdbc90cd301618 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 12:12:25 +0200 Subject: [PATCH 03/13] pre-commit autoupdate --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbf3d37..33b635a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,34 +1,34 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.7.4 + rev: v2.34.0 hooks: - id: pyupgrade args: ["--py36-plus"] - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black args: ["--target-version", "py36"] - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.2 hooks: - id: flake8 additional_dependencies: [flake8-2020] - repo: https://github.com/pycqa/isort - rev: 5.7.0 + rev: 5.10.1 hooks: - id: isort - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.7.0 + rev: v1.9.0 hooks: - id: python-check-blanket-noqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.3.0 hooks: - id: check-merge-conflict - id: check-toml @@ -36,7 +36,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.2.1 + rev: v2.7.1 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] From a64635608bb82104d98d27cf01c46424f5fd77bf Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 12:33:19 +0200 Subject: [PATCH 04/13] Comment out coveralls --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5c01d2..ef03416 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set Up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -31,7 +31,7 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - name: pip cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: @@ -47,10 +47,10 @@ jobs: - name: tox env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: tox -e py,lint,coveralls,release + run: tox -e py,lint,release # coveralls - name: upload dist - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }}_${{ matrix.python-version}}_dist path: dist @@ -61,7 +61,7 @@ jobs: needs: [tox] steps: - name: Download dists for PyPI - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: ubuntu-latest_3.8_dist path: dist From 4e659c10a8d730db07230c8a9f99e517d4dbc358 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 12:35:58 +0200 Subject: [PATCH 05/13] Comment out coveralls --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef03416..214e057 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: - name: tox env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: tox -e py,lint,release # coveralls + run: tox -e py,lint,release # coveralls - name: upload dist uses: actions/upload-artifact@v3 From 2be8cc841e9370a9f1f2e4b7c917ba8914c372fe Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 13:11:55 +0200 Subject: [PATCH 06/13] Jinja2<=3.1 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index cf5877a..20bd123 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ docs = [ "alabaster~=0.7.12", "commonmark~=0.9.1", "docutils~=0.16.0", + "Jinja2<=3.1", "mock~=4.0", "pillow~=7.2", "readthedocs-sphinx-ext~=2.1", From a5f320e9f1da36452efaa0cbb7a95e1bc30d3d40 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 13:15:55 +0200 Subject: [PATCH 07/13] Jinja2<3.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 20bd123..ddf2d9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ docs = [ "alabaster~=0.7.12", "commonmark~=0.9.1", "docutils~=0.16.0", - "Jinja2<=3.1", + "Jinja2<3.1", "mock~=4.0", "pillow~=7.2", "readthedocs-sphinx-ext~=2.1", From 88055b066daf9d90578dde581aadb9d50e236a49 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 13:33:12 +0200 Subject: [PATCH 08/13] pyupgrade --py37-plus --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33b635a..1ef754a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,13 +3,13 @@ repos: rev: v2.34.0 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: ["--py37-plus"] - repo: https://github.com/psf/black rev: 22.3.0 hooks: - id: black - args: ["--target-version", "py36"] + args: ["--target-version", "py37"] - repo: https://gitlab.com/pycqa/flake8 rev: 3.9.2 From 97887c1a9e36c022da15eb98d713e56778bc56b4 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 13:42:01 +0200 Subject: [PATCH 09/13] isort remove_imports generator_stop --- docs/conf.py | 3 --- modernize/__init__.py | 1 - modernize/__main__.py | 2 -- modernize/fixes/__init__.py | 2 -- modernize/fixes/fix_basestring.py | 2 -- modernize/fixes/fix_classic_division.py | 2 -- modernize/fixes/fix_dict_six.py | 1 - modernize/fixes/fix_file.py | 2 -- modernize/fixes/fix_filter.py | 1 - modernize/fixes/fix_import.py | 2 -- modernize/fixes/fix_imports_six.py | 2 -- modernize/fixes/fix_input_six.py | 1 - modernize/fixes/fix_int_long_tuple.py | 2 -- modernize/fixes/fix_itertools_imports_six.py | 1 - modernize/fixes/fix_itertools_six.py | 4 ++-- modernize/fixes/fix_map.py | 1 - modernize/fixes/fix_metaclass.py | 4 ++-- modernize/fixes/fix_next.py | 1 - modernize/fixes/fix_open.py | 2 -- modernize/fixes/fix_print.py | 2 -- modernize/fixes/fix_raise.py | 4 ++-- modernize/fixes/fix_raise_six.py | 4 ++-- modernize/fixes/fix_unichr.py | 2 -- modernize/fixes/fix_unicode.py | 2 -- modernize/fixes/fix_unicode_future.py | 2 -- modernize/fixes/fix_unicode_type.py | 2 -- modernize/fixes/fix_urllib_six.py | 4 ++-- modernize/fixes/fix_xrange_six.py | 1 - modernize/fixes/fix_zip.py | 1 - modernize/main.py | 1 - modernize/utils.py | 2 -- pyproject.toml | 4 ++-- tests/test_fix_basestring.py | 2 -- tests/test_fix_classic_division.py | 2 -- tests/test_fix_dict_six.py | 2 -- tests/test_fix_file.py | 2 -- tests/test_fix_filter.py | 2 -- tests/test_fix_import.py | 2 -- tests/test_fix_imports_six.py | 2 -- tests/test_fix_input_six.py | 2 -- tests/test_fix_int_long_tuple.py | 2 -- tests/test_fix_itertools_imports_six.py | 2 -- tests/test_fix_map.py | 2 -- tests/test_fix_metaclass.py | 2 -- tests/test_fix_next.py | 2 -- tests/test_fix_open.py | 2 -- tests/test_fix_print.py | 2 -- tests/test_fix_raise.py | 2 -- tests/test_fix_unichr_type.py | 2 -- tests/test_fix_unicode.py | 2 -- tests/test_fix_unicode_type.py | 2 -- tests/test_fix_urllib_six.py | 2 -- tests/test_fix_xrange_six.py | 2 -- tests/test_fix_zip.py | 2 -- tests/test_fixes.py | 2 -- tests/test_future_behaviour.py | 1 - tests/test_main.py | 2 -- tests/test_raise_six.py | 2 -- tests/utils.py | 2 -- 59 files changed, 12 insertions(+), 108 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 49abf3a..bab0633 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. diff --git a/modernize/__init__.py b/modernize/__init__.py index 0b52328..3bc3d88 100644 --- a/modernize/__init__.py +++ b/modernize/__init__.py @@ -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" diff --git a/modernize/__main__.py b/modernize/__main__.py index c03922b..21eba35 100644 --- a/modernize/__main__.py +++ b/modernize/__main__.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - import sys from .main import main diff --git a/modernize/fixes/__init__.py b/modernize/fixes/__init__.py index 855ce80..c6f9d97 100644 --- a/modernize/fixes/__init__.py +++ b/modernize/fixes/__init__.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - fissix_fix_names = { "fissix.fixes.fix_apply", "fissix.fixes.fix_except", diff --git a/modernize/fixes/fix_basestring.py b/modernize/fixes/fix_basestring.py index cd5d532..5c53c10 100644 --- a/modernize/fixes/fix_basestring.py +++ b/modernize/fixes/fix_basestring.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base, fixer_util diff --git a/modernize/fixes/fix_classic_division.py b/modernize/fixes/fix_classic_division.py index bbc84c1..2aaa4b4 100644 --- a/modernize/fixes/fix_classic_division.py +++ b/modernize/fixes/fix_classic_division.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base, pytree from fissix.pgen2 import token diff --git a/modernize/fixes/fix_dict_six.py b/modernize/fixes/fix_dict_six.py index 7de96cf..ce2e63b 100644 --- a/modernize/fixes/fix_dict_six.py +++ b/modernize/fixes/fix_dict_six.py @@ -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 diff --git a/modernize/fixes/fix_file.py b/modernize/fixes/fix_file.py index 35581b8..dbc05e4 100644 --- a/modernize/fixes/fix_file.py +++ b/modernize/fixes/fix_file.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base from fissix.fixer_util import Name diff --git a/modernize/fixes/fix_filter.py b/modernize/fixes/fix_filter.py index f179c6a..efca4a4 100644 --- a/modernize/fixes/fix_filter.py +++ b/modernize/fixes/fix_filter.py @@ -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 diff --git a/modernize/fixes/fix_import.py b/modernize/fixes/fix_import.py index 93c3dbe..4b81121 100644 --- a/modernize/fixes/fix_import.py +++ b/modernize/fixes/fix_import.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix.fixer_util import syms from fissix.fixes import fix_import diff --git a/modernize/fixes/fix_imports_six.py b/modernize/fixes/fix_imports_six.py index 9015c0a..7901d55 100644 --- a/modernize/fixes/fix_imports_six.py +++ b/modernize/fixes/fix_imports_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix.fixes import fix_imports diff --git a/modernize/fixes/fix_input_six.py b/modernize/fixes/fix_input_six.py index b52c692..1d722ea 100644 --- a/modernize/fixes/fix_input_six.py +++ b/modernize/fixes/fix_input_six.py @@ -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 diff --git a/modernize/fixes/fix_int_long_tuple.py b/modernize/fixes/fix_int_long_tuple.py index 058bbf5..c2e0b3f 100644 --- a/modernize/fixes/fix_int_long_tuple.py +++ b/modernize/fixes/fix_int_long_tuple.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base, fixer_util diff --git a/modernize/fixes/fix_itertools_imports_six.py b/modernize/fixes/fix_itertools_imports_six.py index 8024d71..f5ba320 100644 --- a/modernize/fixes/fix_itertools_imports_six.py +++ b/modernize/fixes/fix_itertools_imports_six.py @@ -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 diff --git a/modernize/fixes/fix_itertools_six.py b/modernize/fixes/fix_itertools_six.py index b6ff62a..ddeca2d 100644 --- a/modernize/fixes/fix_itertools_six.py +++ b/modernize/fixes/fix_itertools_six.py @@ -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. @@ -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 diff --git a/modernize/fixes/fix_map.py b/modernize/fixes/fix_map.py index 08c5ca9..16f3fb2 100644 --- a/modernize/fixes/fix_map.py +++ b/modernize/fixes/fix_map.py @@ -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 diff --git a/modernize/fixes/fix_metaclass.py b/modernize/fixes/fix_metaclass.py index 2bccdb9..2c4cac5 100644 --- a/modernize/fixes/fix_metaclass.py +++ b/modernize/fixes/fix_metaclass.py @@ -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. @@ -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 diff --git a/modernize/fixes/fix_next.py b/modernize/fixes/fix_next.py index db275cf..b64ec91 100644 --- a/modernize/fixes/fix_next.py +++ b/modernize/fixes/fix_next.py @@ -1,6 +1,5 @@ """Fixer for it.next() -> next(it)""" -from __future__ import generator_stop # Local imports from fissix import fixer_base diff --git a/modernize/fixes/fix_open.py b/modernize/fixes/fix_open.py index 4673226..60a0e7c 100644 --- a/modernize/fixes/fix_open.py +++ b/modernize/fixes/fix_open.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base, fixer_util diff --git a/modernize/fixes/fix_print.py b/modernize/fixes/fix_print.py index 1384ed3..0062e0d 100644 --- a/modernize/fixes/fix_print.py +++ b/modernize/fixes/fix_print.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix.fixes import fix_print from .. import utils diff --git a/modernize/fixes/fix_raise.py b/modernize/fixes/fix_raise.py index 68ef28c..a10fc42 100644 --- a/modernize/fixes/fix_raise.py +++ b/modernize/fixes/fix_raise.py @@ -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 diff --git a/modernize/fixes/fix_raise_six.py b/modernize/fixes/fix_raise_six.py index 54f4f7a..8fb27f8 100644 --- a/modernize/fixes/fix_raise_six.py +++ b/modernize/fixes/fix_raise_six.py @@ -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 diff --git a/modernize/fixes/fix_unichr.py b/modernize/fixes/fix_unichr.py index ff1e681..608fef6 100644 --- a/modernize/fixes/fix_unichr.py +++ b/modernize/fixes/fix_unichr.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base, fixer_util from fissix.fixer_util import is_probably_builtin diff --git a/modernize/fixes/fix_unicode.py b/modernize/fixes/fix_unicode.py index 5e75282..37c008f 100644 --- a/modernize/fixes/fix_unicode.py +++ b/modernize/fixes/fix_unicode.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - import re from fissix import fixer_base, fixer_util diff --git a/modernize/fixes/fix_unicode_future.py b/modernize/fixes/fix_unicode_future.py index 8296570..2129d96 100644 --- a/modernize/fixes/fix_unicode_future.py +++ b/modernize/fixes/fix_unicode_future.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix.fixes import fix_unicode from .. import utils diff --git a/modernize/fixes/fix_unicode_type.py b/modernize/fixes/fix_unicode_type.py index e7fe70f..f5d8664 100644 --- a/modernize/fixes/fix_unicode_type.py +++ b/modernize/fixes/fix_unicode_type.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import fixer_base, fixer_util diff --git a/modernize/fixes/fix_urllib_six.py b/modernize/fixes/fix_urllib_six.py index 39733fb..4f6fd7b 100644 --- a/modernize/fixes/fix_urllib_six.py +++ b/modernize/fixes/fix_urllib_six.py @@ -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. @@ -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, diff --git a/modernize/fixes/fix_xrange_six.py b/modernize/fixes/fix_xrange_six.py index 1e308cd..1abc521 100644 --- a/modernize/fixes/fix_xrange_six.py +++ b/modernize/fixes/fix_xrange_six.py @@ -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 diff --git a/modernize/fixes/fix_zip.py b/modernize/fixes/fix_zip.py index 58bb66c..45a2b73 100644 --- a/modernize/fixes/fix_zip.py +++ b/modernize/fixes/fix_zip.py @@ -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 diff --git a/modernize/main.py b/modernize/main.py index 962fbf0..be544f8 100644 --- a/modernize/main.py +++ b/modernize/main.py @@ -5,7 +5,6 @@ |_|_|_\\___/\\__,_\\___|_| |_||_|_/__\\___|\ """ -from __future__ import generator_stop import logging import optparse diff --git a/modernize/utils.py b/modernize/utils.py index 2d1921c..bdc990a 100644 --- a/modernize/utils.py +++ b/modernize/utils.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index ddf2d9a..73613ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -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 = [ diff --git a/tests/test_fix_basestring.py b/tests/test_fix_basestring.py index 78f8bd5..33f993a 100644 --- a/tests/test_fix_basestring.py +++ b/tests/test_fix_basestring.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input BASESTRING = ( diff --git a/tests/test_fix_classic_division.py b/tests/test_fix_classic_division.py index e7fc089..0de7186 100644 --- a/tests/test_fix_classic_division.py +++ b/tests/test_fix_classic_division.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input CLASSIC_DIVISION = ( diff --git a/tests/test_fix_dict_six.py b/tests/test_fix_dict_six.py index 950941e..cac78cd 100644 --- a/tests/test_fix_dict_six.py +++ b/tests/test_fix_dict_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input TYPES = "keys", "items", "values" diff --git a/tests/test_fix_file.py b/tests/test_fix_file.py index 6b55b17..3bd5a67 100644 --- a/tests/test_fix_file.py +++ b/tests/test_fix_file.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input FILE_CALL = ( diff --git a/tests/test_fix_filter.py b/tests/test_fix_filter.py index efd2871..52f31e5 100644 --- a/tests/test_fix_filter.py +++ b/tests/test_fix_filter.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input FILTER_CALL = ( diff --git a/tests/test_fix_import.py b/tests/test_fix_import.py index 3f26370..3b902c0 100644 --- a/tests/test_fix_import.py +++ b/tests/test_fix_import.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input NO_IMPORTS = ( diff --git a/tests/test_fix_imports_six.py b/tests/test_fix_imports_six.py index 66df698..d99db16 100644 --- a/tests/test_fix_imports_six.py +++ b/tests/test_fix_imports_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - import sys import unittest diff --git a/tests/test_fix_input_six.py b/tests/test_fix_input_six.py index 4dd15c9..8947b5b 100644 --- a/tests/test_fix_input_six.py +++ b/tests/test_fix_input_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input INPUT = ( diff --git a/tests/test_fix_int_long_tuple.py b/tests/test_fix_int_long_tuple.py index 0c869cb..c423374 100644 --- a/tests/test_fix_int_long_tuple.py +++ b/tests/test_fix_int_long_tuple.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input INT_LONG_ISINSTANCE = ( diff --git a/tests/test_fix_itertools_imports_six.py b/tests/test_fix_itertools_imports_six.py index 8e2708d..bf3e0b1 100644 --- a/tests/test_fix_itertools_imports_six.py +++ b/tests/test_fix_itertools_imports_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input IZIP_AND_CHAIN_REFERENCE = ( diff --git a/tests/test_fix_map.py b/tests/test_fix_map.py index 6bf6a39..2b32ff8 100644 --- a/tests/test_fix_map.py +++ b/tests/test_fix_map.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input MAP_1_ARG = ( diff --git a/tests/test_fix_metaclass.py b/tests/test_fix_metaclass.py index 22f75c1..3a59384 100644 --- a/tests/test_fix_metaclass.py +++ b/tests/test_fix_metaclass.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input METACLASS_NO_BASE = ( diff --git a/tests/test_fix_next.py b/tests/test_fix_next.py index 00329e3..f79ba67 100644 --- a/tests/test_fix_next.py +++ b/tests/test_fix_next.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input NEXT_METHOD = ( diff --git a/tests/test_fix_open.py b/tests/test_fix_open.py index 6761811..4669220 100644 --- a/tests/test_fix_open.py +++ b/tests/test_fix_open.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input OPEN = ( diff --git a/tests/test_fix_print.py b/tests/test_fix_print.py index 3459883..66549f3 100644 --- a/tests/test_fix_print.py +++ b/tests/test_fix_print.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input PRINT_BARE = ( diff --git a/tests/test_fix_raise.py b/tests/test_fix_raise.py index 8b3fad9..57a50ff 100644 --- a/tests/test_fix_raise.py +++ b/tests/test_fix_raise.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input RAISE = ( diff --git a/tests/test_fix_unichr_type.py b/tests/test_fix_unichr_type.py index 5338bc7..665bb6a 100644 --- a/tests/test_fix_unichr_type.py +++ b/tests/test_fix_unichr_type.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input UNICHR_METHOD_REF = ( diff --git a/tests/test_fix_unicode.py b/tests/test_fix_unicode.py index 0f8e9c0..e4c3d52 100644 --- a/tests/test_fix_unicode.py +++ b/tests/test_fix_unicode.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input UNICODE_LITERALS = """\ diff --git a/tests/test_fix_unicode_type.py b/tests/test_fix_unicode_type.py index 43c2656..8f507d5 100644 --- a/tests/test_fix_unicode_type.py +++ b/tests/test_fix_unicode_type.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input UNICODE_TYPE_REF = ( diff --git a/tests/test_fix_urllib_six.py b/tests/test_fix_urllib_six.py index 8dfa963..335f6b8 100644 --- a/tests/test_fix_urllib_six.py +++ b/tests/test_fix_urllib_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input URLLIB_MODULE_REFERENCE = ( diff --git a/tests/test_fix_xrange_six.py b/tests/test_fix_xrange_six.py index 9a3ec26..972157e 100644 --- a/tests/test_fix_xrange_six.py +++ b/tests/test_fix_xrange_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input RANGE = ( diff --git a/tests/test_fix_zip.py b/tests/test_fix_zip.py index e7a89f9..d3f5238 100644 --- a/tests/test_fix_zip.py +++ b/tests/test_fix_zip.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input ZIP_CALL_NO_ARGS = ( diff --git a/tests/test_fixes.py b/tests/test_fixes.py index e406d0f..52b6aa4 100644 --- a/tests/test_fixes.py +++ b/tests/test_fixes.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from fissix import refactor from modernize import fixes diff --git a/tests/test_future_behaviour.py b/tests/test_future_behaviour.py index e6fba63..00b55dc 100644 --- a/tests/test_future_behaviour.py +++ b/tests/test_future_behaviour.py @@ -1,6 +1,5 @@ # Tests for problem with multiple futures added to single file -from __future__ import generator_stop import os import shutil diff --git a/tests/test_main.py b/tests/test_main.py index eaceeb3..e4ab8ba 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - import contextlib import io diff --git a/tests/test_raise_six.py b/tests/test_raise_six.py index 44163f9..3c2944e 100644 --- a/tests/test_raise_six.py +++ b/tests/test_raise_six.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - from utils import check_on_input RAISE_TRACEBACK = ( diff --git a/tests/utils.py b/tests/utils.py index 6f84434..882f9c4 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,5 +1,3 @@ -from __future__ import generator_stop - import os.path import shutil import tempfile From c162ed8286805c92006e2928057a362ab02a3da0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 13:56:59 +0200 Subject: [PATCH 10/13] Remove coveralls using changes in #253 --- .github/workflows/main.yml | 8 +++++++- README.rst | 3 --- pyproject.toml | 8 -------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 214e057..75e7570 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,13 @@ jobs: - name: tox env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: tox -e py,lint,release # coveralls + run: tox -e py,lint,release + + - uses: codecov/codecov-action@v2 + with: + name: ${{ matrix.os }}_${{ matrix.python-version}} + fail_ci_if_error: true + verbose: true - name: upload dist uses: actions/upload-artifact@v3 diff --git a/README.rst b/README.rst index 6422e85..4da1b86 100644 --- a/README.rst +++ b/README.rst @@ -6,9 +6,6 @@ |_|_|_\___/\__,_\___|_| |_||_|_/__\___| -.. image:: https://img.shields.io/coveralls/github/PyCQA/modernize?label=coveralls&logo=coveralls - :alt: Coveralls - :target: https://coveralls.io/github/PyCQA/modernize .. image:: https://img.shields.io/readthedocs/modernize?logo=read-the-docs :alt: Read the Docs :target: https://modernize.readthedocs.io/en/latest/ diff --git a/pyproject.toml b/pyproject.toml index 73613ea..5bb0f1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,19 +98,11 @@ wheel_build_env = build # empty environment to build universal wheel once per tox invocation # https://github.com/ionelmc/tox-wheel#build-configuration -[testenv:coveralls] -passenv = GITHUB_* -deps = - coveralls - coverage>=5.3 -commands = coveralls - [testenv:lint] deps = pre-commit commands = pre-commit run --all-files --show-diff-on-failure {posargs} skip_install = true - [testenv:release] deps = pep517 whitelist_externals = From 1c0187e8797fb0fd45a3a3a92c3c77110a11f437 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 27 Jun 2022 14:05:54 +0200 Subject: [PATCH 11/13] Revert: Remove coveralls using changes in #253 --- .github/workflows/main.yml | 8 +------- README.rst | 3 +++ pyproject.toml | 7 +++++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75e7570..214e057 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,13 +47,7 @@ jobs: - name: tox env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: tox -e py,lint,release - - - uses: codecov/codecov-action@v2 - with: - name: ${{ matrix.os }}_${{ matrix.python-version}} - fail_ci_if_error: true - verbose: true + run: tox -e py,lint,release # coveralls - name: upload dist uses: actions/upload-artifact@v3 diff --git a/README.rst b/README.rst index 4da1b86..6422e85 100644 --- a/README.rst +++ b/README.rst @@ -6,6 +6,9 @@ |_|_|_\___/\__,_\___|_| |_||_|_/__\___| +.. image:: https://img.shields.io/coveralls/github/PyCQA/modernize?label=coveralls&logo=coveralls + :alt: Coveralls + :target: https://coveralls.io/github/PyCQA/modernize .. image:: https://img.shields.io/readthedocs/modernize?logo=read-the-docs :alt: Read the Docs :target: https://modernize.readthedocs.io/en/latest/ diff --git a/pyproject.toml b/pyproject.toml index 5bb0f1c..e39f2bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,13 @@ wheel_build_env = build # empty environment to build universal wheel once per tox invocation # https://github.com/ionelmc/tox-wheel#build-configuration +[testenv:coveralls] +passenv = GITHUB_* +deps = + coveralls + coverage>=5.3 +commands = coveralls + [testenv:lint] deps = pre-commit commands = pre-commit run --all-files --show-diff-on-failure {posargs} From 841dc61dbe70d8a30f9b33f70fa0489ad073475b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 21 Mar 2023 14:11:30 +0100 Subject: [PATCH 12/13] Add Python 3.11 --- .github/workflows/main.yml | 2 +- .pre-commit-config.yaml | 18 +++++++++--------- modernize/fixes/fix_file.py | 1 - modernize/fixes/fix_filter.py | 1 - modernize/fixes/fix_import.py | 1 - modernize/fixes/fix_imports_six.py | 1 - modernize/fixes/fix_input_six.py | 1 - modernize/fixes/fix_int_long_tuple.py | 1 - modernize/fixes/fix_map.py | 1 - modernize/fixes/fix_open.py | 1 - modernize/fixes/fix_raise_six.py | 1 - modernize/fixes/fix_xrange_six.py | 1 - modernize/fixes/fix_zip.py | 1 - modernize/utils.py | 1 - setup.cfg | 4 ++-- tests/test_fix_imports_six.py | 2 +- tests/test_future_behaviour.py | 4 ++-- tests/utils.py | 2 +- 18 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 214e057..7ac751f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] os: [macOS-latest, ubuntu-latest, windows-latest] steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ef754a..48f6c12 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,34 +1,34 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v3.3.1 hooks: - id: pyupgrade args: ["--py37-plus"] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black args: ["--target-version", "py37"] - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.2 + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: [flake8-2020] - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: python-check-blanket-noqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: check-merge-conflict - id: check-toml @@ -36,13 +36,13 @@ repos: - id: mixed-line-ending - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v3.0.0-alpha.6 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] - repo: https://github.com/myint/autoflake - rev: v1.4 + rev: v2.0.2 hooks: - id: autoflake args: diff --git a/modernize/fixes/fix_file.py b/modernize/fixes/fix_file.py index dbc05e4..6c4e608 100644 --- a/modernize/fixes/fix_file.py +++ b/modernize/fixes/fix_file.py @@ -3,7 +3,6 @@ class FixFile(fixer_base.BaseFix): - BM_compatible = True order = "pre" diff --git a/modernize/fixes/fix_filter.py b/modernize/fixes/fix_filter.py index efca4a4..2759b9a 100644 --- a/modernize/fixes/fix_filter.py +++ b/modernize/fixes/fix_filter.py @@ -9,7 +9,6 @@ class FixFilter(fix_filter.FixFilter): - skip_on = "six.moves.filter" def transform(self, node, results): diff --git a/modernize/fixes/fix_import.py b/modernize/fixes/fix_import.py index 4b81121..1fcda26 100644 --- a/modernize/fixes/fix_import.py +++ b/modernize/fixes/fix_import.py @@ -5,7 +5,6 @@ class FixImport(fix_import.FixImport): - # Make sure this runs before any other fixer to guarantee that any other # added absolute_import doesn't block this fixer's execution. run_order = 1 diff --git a/modernize/fixes/fix_imports_six.py b/modernize/fixes/fix_imports_six.py index 7901d55..7ae9993 100644 --- a/modernize/fixes/fix_imports_six.py +++ b/modernize/fixes/fix_imports_six.py @@ -2,7 +2,6 @@ class FixImportsSix(fix_imports.FixImports): - mapping = { "__builtin__": "six.moves.builtins", "_winreg": "six.moves.winreg", diff --git a/modernize/fixes/fix_input_six.py b/modernize/fixes/fix_input_six.py index 1d722ea..f182d98 100644 --- a/modernize/fixes/fix_input_six.py +++ b/modernize/fixes/fix_input_six.py @@ -14,7 +14,6 @@ class FixInputSix(fixer_base.ConditionalFix): - BM_compatible = True order = "pre" skip_on = "six.moves.input" diff --git a/modernize/fixes/fix_int_long_tuple.py b/modernize/fixes/fix_int_long_tuple.py index c2e0b3f..0b8c273 100644 --- a/modernize/fixes/fix_int_long_tuple.py +++ b/modernize/fixes/fix_int_long_tuple.py @@ -2,7 +2,6 @@ class FixIntLongTuple(fixer_base.BaseFix): - run_order = 4 # Must run before fix_long. PATTERN = """ diff --git a/modernize/fixes/fix_map.py b/modernize/fixes/fix_map.py index 16f3fb2..155ef66 100644 --- a/modernize/fixes/fix_map.py +++ b/modernize/fixes/fix_map.py @@ -9,7 +9,6 @@ class FixMap(fix_map.FixMap): - skip_on = "six.moves.map" def transform(self, node, results): diff --git a/modernize/fixes/fix_open.py b/modernize/fixes/fix_open.py index 60a0e7c..6039721 100644 --- a/modernize/fixes/fix_open.py +++ b/modernize/fixes/fix_open.py @@ -2,7 +2,6 @@ class FixOpen(fixer_base.BaseFix): - BM_compatible = True # Fixers don't directly stack, so make sure the 'file' case is covered. PATTERN = """ diff --git a/modernize/fixes/fix_raise_six.py b/modernize/fixes/fix_raise_six.py index 8fb27f8..491fc94 100644 --- a/modernize/fixes/fix_raise_six.py +++ b/modernize/fixes/fix_raise_six.py @@ -12,7 +12,6 @@ class FixRaiseSix(fixer_base.BaseFix): - BM_compatible = True PATTERN = """ raise_stmt< 'raise' exc=any ',' val=any ',' tb=any > diff --git a/modernize/fixes/fix_xrange_six.py b/modernize/fixes/fix_xrange_six.py index 1abc521..e7d4e33 100644 --- a/modernize/fixes/fix_xrange_six.py +++ b/modernize/fixes/fix_xrange_six.py @@ -7,7 +7,6 @@ class FixXrangeSix(fixer_base.ConditionalFix, fix_xrange.FixXrange): - skip_on = "six.moves.range" def transform(self, node, results): diff --git a/modernize/fixes/fix_zip.py b/modernize/fixes/fix_zip.py index 45a2b73..56a79bc 100644 --- a/modernize/fixes/fix_zip.py +++ b/modernize/fixes/fix_zip.py @@ -7,7 +7,6 @@ class FixZip(fix_zip.FixZip): - skip_on = "six.moves.zip" def transform(self, node, results): diff --git a/modernize/utils.py b/modernize/utils.py index bdc990a..542162d 100644 --- a/modernize/utils.py +++ b/modernize/utils.py @@ -49,7 +49,6 @@ def _check_future_import(node): def add_future(node, symbol): - root = fixer_util.find_root(node) for idx, node in enumerate(root.children): diff --git a/setup.cfg b/setup.cfg index 3c31630..8db0025 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,5 +5,5 @@ tag-format = v{version} [flake8] disable-noqa = True max-line-length = 88 -extend-ignore = - E203, # whitespace before : is not PEP8 compliant (& conflicts with black) +extend-ignore = E203 +# E203 whitespace before : is not PEP8 compliant (& conflicts with black) diff --git a/tests/test_fix_imports_six.py b/tests/test_fix_imports_six.py index d99db16..eb121ac 100644 --- a/tests/test_fix_imports_six.py +++ b/tests/test_fix_imports_six.py @@ -2,7 +2,7 @@ import unittest try: - from six.moves import tkinter + import tkinter except ImportError: tkinter = None diff --git a/tests/test_future_behaviour.py b/tests/test_future_behaviour.py index 00b55dc..5c980ca 100644 --- a/tests/test_future_behaviour.py +++ b/tests/test_future_behaviour.py @@ -65,7 +65,7 @@ def _check_on_input(file_content, extra_flags=[]): try: tmpdirname = tempfile.mkdtemp() test_input_name = os.path.join(tmpdirname, "input.py") - with open(test_input_name, "wt") as input: + with open(test_input_name, "w") as input: input.write(file_content) modernize_main(extra_flags + ["-w", test_input_name]) _check_for_multiple_futures(test_input_name, file_content) @@ -93,7 +93,7 @@ def test_two_files_on_single_run(): os.path.join(tmpdirname, f"input_{idx}.py") for idx in range(0, 3) ] for input_name in input_names: - with open(input_name, "wt") as input: + with open(input_name, "w") as input: input.write(TWO_PRINTS_CONTENT) modernize_main(["-w"] + input_names) for input_name in input_names: diff --git a/tests/utils.py b/tests/utils.py index 882f9c4..5da313b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -21,7 +21,7 @@ def check_on_input( tmpdirname = tempfile.mkdtemp() try: test_input_name = os.path.join(tmpdirname, "input.py") - with open(test_input_name, "wt") as input_file: + with open(test_input_name, "w") as input_file: input_file.write(input_content) def _check(this_input_content, which_check, check_return_code=True): From ac3d2b198ccd6f55736d48e6c914196be40646a2 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 21 Mar 2023 14:14:42 +0100 Subject: [PATCH 13/13] Add Python 3.11 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e39f2bf..b64be98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] description-file = "README.rst" requires = ["fissix"] @@ -80,7 +81,7 @@ legacy_tox_ini = """ [tox] envlist = - py{37,38,39,310},lint + py{37,38,39,310,311},lint minversion=3.20.1 isolated_build=true requires=