Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action: Add Python 3.10 and remove 3.6 #256

Closed
wants to merge 13 commits into from
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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", "3.11"]
os: [macOS-latest, ubuntu-latest, windows-latest]

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py36-plus"]
args: ["--py37-plus"]

- repo: https://github.com/psf/black
rev: 20.8b1
rev: 23.1.0
hooks:
- id: black
args: ["--target-version", "py36"]
args: ["--target-version", "py37"]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
- 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.7.0
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.7.0
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: mixed-line-ending

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.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:
Expand Down
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
3 changes: 0 additions & 3 deletions modernize/fixes/fix_file.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
from __future__ import generator_stop

from fissix import fixer_base
from fissix.fixer_util import Name


class FixFile(fixer_base.BaseFix):

BM_compatible = True
order = "pre"

Expand Down
2 changes: 0 additions & 2 deletions 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 All @@ -10,7 +9,6 @@


class FixFilter(fix_filter.FixFilter):

skip_on = "six.moves.filter"

def transform(self, node, results):
Expand Down
3 changes: 0 additions & 3 deletions modernize/fixes/fix_import.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from __future__ import generator_stop

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

from .. import utils


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
Expand Down
3 changes: 0 additions & 3 deletions modernize/fixes/fix_imports_six.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from __future__ import generator_stop

from fissix.fixes import fix_imports


class FixImportsSix(fix_imports.FixImports):

mapping = {
"__builtin__": "six.moves.builtins",
"_winreg": "six.moves.winreg",
Expand Down
2 changes: 0 additions & 2 deletions modernize/fixes/fix_input_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
# 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


class FixInputSix(fixer_base.ConditionalFix):

BM_compatible = True
order = "pre"
skip_on = "six.moves.input"
Expand Down
3 changes: 0 additions & 3 deletions modernize/fixes/fix_int_long_tuple.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util


class FixIntLongTuple(fixer_base.BaseFix):

run_order = 4 # Must run before fix_long.

PATTERN = """
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
2 changes: 0 additions & 2 deletions 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 All @@ -10,7 +9,6 @@


class FixMap(fix_map.FixMap):

skip_on = "six.moves.map"

def transform(self, node, results):
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
3 changes: 0 additions & 3 deletions modernize/fixes/fix_open.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from __future__ import generator_stop

from fissix import fixer_base, fixer_util


class FixOpen(fixer_base.BaseFix):

BM_compatible = True
# Fixers don't directly stack, so make sure the 'file' case is covered.
PATTERN = """
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
5 changes: 2 additions & 3 deletions modernize/fixes/fix_raise_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
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


class FixRaiseSix(fixer_base.BaseFix):

BM_compatible = True
PATTERN = """
raise_stmt< 'raise' exc=any ',' val=any ',' tb=any >
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
Loading