Skip to content

Commit 8c79b21

Browse files
authored
Merge pull request #1160 from PyCQA/py38-plus
drop python 3.7 support
2 parents 2012b14 + 933eed8 commit 8c79b21

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ jobs:
1616
- os: ubuntu-latest
1717
py: pypy3.10
1818
toxenv: py
19-
- os: ubuntu-latest
20-
py: 3.7
21-
toxenv: py
2219
- os: ubuntu-latest
2320
py: 3.8
2421
toxenv: py

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ repos:
1111
rev: v3.10.0
1212
hooks:
1313
- id: reorder-python-imports
14-
args: [--py37-plus]
14+
args: [--py38-plus]
1515
- repo: https://github.com/asottile/pyupgrade
1616
rev: v3.9.0
1717
hooks:
1818
- id: pyupgrade
19-
args: [--py37-plus]
19+
args: [--py38-plus]
2020
- repo: https://github.com/pycqa/flake8
2121
rev: 6.0.0
2222
hooks:

pycodestyle.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
sys.version_info < (3, 10) and
6767
callable(getattr(tokenize, '_compile', None))
6868
): # pragma: no cover (<py310)
69-
tokenize._compile = lru_cache()(tokenize._compile) # type: ignore
69+
tokenize._compile = lru_cache(tokenize._compile) # type: ignore
7070

7171
__version__ = '2.10.0'
7272

@@ -106,12 +106,10 @@
106106
UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-'])
107107
ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-', '@'])
108108
WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%'])
109-
ASSIGNMENT_EXPRESSION_OP = [':='] if sys.version_info >= (3, 8) else []
110109
WS_NEEDED_OPERATORS = frozenset([
111110
'**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>',
112111
'%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '=',
113-
'and', 'in', 'is', 'or', '->'] +
114-
ASSIGNMENT_EXPRESSION_OP)
112+
'and', 'in', 'is', 'or', '->', ':='])
115113
WHITESPACE = frozenset(' \t\xa0')
116114
NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE])
117115
SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT])
@@ -1219,11 +1217,12 @@ def compound_statements(logical_line):
12191217
counts = {char: 0 for char in '{}[]()'}
12201218
while -1 < found < last_char:
12211219
update_counts(line[prev_found:found], counts)
1222-
if ((counts['{'] <= counts['}'] and # {'a': 1} (dict)
1223-
counts['['] <= counts[']'] and # [1:2] (slice)
1224-
counts['('] <= counts[')']) and # (annotation)
1225-
not (sys.version_info >= (3, 8) and
1226-
line[found + 1] == '=')): # assignment expression
1220+
if (
1221+
counts['{'] <= counts['}'] and # {'a': 1} (dict)
1222+
counts['['] <= counts[']'] and # [1:2] (slice)
1223+
counts['('] <= counts[')'] and # (annotation)
1224+
line[found + 1] != '=' # assignment expression
1225+
):
12271226
lambda_kw = LAMBDA_REGEX.search(line, 0, found)
12281227
if lambda_kw:
12291228
before = line[:lambda_kw.start()].rstrip()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_long_description():
3131
py_modules=['pycodestyle'],
3232
include_package_data=True,
3333
zip_safe=False,
34-
python_requires='>=3.7',
34+
python_requires='>=3.8',
3535
entry_points={
3636
'console_scripts': [
3737
'pycodestyle = pycodestyle:_main',

0 commit comments

Comments
 (0)