Skip to content

Commit

Permalink
Python, dependency, and CHANGELOG bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwager committed Feb 6, 2023
1 parent 1e0faa4 commit d05a692
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 61 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Support for Flake8 6 ([#56](https://github.com/dlint-py/dlint/issues/56))
- Support for Python 3.11

### Removed

- Support for Python 3.6

## [0.13.0] - 2022-08-09

### Added
Expand Down
7 changes: 1 addition & 6 deletions dlint/tree.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import ast
import sys


def decorator_name(decorator):
Expand Down Expand Up @@ -67,13 +66,9 @@ def non_empty_return(_return):


def walk_callback_same_scope(node, callback):
is_python_3_6 = sys.version_info >= (3, 6)

# If we change scope, e.g. enter into a new
# class or function definition, then halt iteration
scopes = (ast.ClassDef, ast.FunctionDef)
if is_python_3_6:
scopes += (ast.AsyncFunctionDef,)
scopes = (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)

def scope_predicate(inner_node):
return not isinstance(inner_node, scopes)
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==6.2.5
pytest-benchmark==3.4.1
pytest-cov==3.0.0
coveralls==1.11.0
pytest==7.2.1
pytest-benchmark==4.0.0
pytest-cov==4.0.0
coveralls==3.3.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'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',
'Programming Language :: Python :: 3.11',
'Topic :: Security',
'Topic :: Software Development :: Quality Assurance',
],
Expand Down
5 changes: 0 additions & 5 deletions tests/test_helpers/test_bad_name_attribute_use.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/usr/bin/env python

import sys
import unittest

import dlint

IS_PYTHON_3_6 = sys.version_info >= (3, 6)


def get_bad_name_attribute_use_implementation(illegal_name_attributes):
class Cls(dlint.linters.helpers.bad_name_attribute_use.BadNameAttributeUseLinter):
Expand Down Expand Up @@ -125,7 +122,6 @@ def inner_func():

assert result == expected

@unittest.skipUnless(IS_PYTHON_3_6, 'async statements introduced in Python 3.6')
def test_bad_name_attributes_async_nested(self):
python_node = self.get_ast_node(
"""
Expand Down Expand Up @@ -188,7 +184,6 @@ def inner_func():

assert result == expected

@unittest.skipUnless(IS_PYTHON_3_6, 'async statements introduced in Python 3.6')
def test_bad_name_attributes_async_nested_overwrite(self):
python_node = self.get_ast_node(
"""
Expand Down
51 changes: 6 additions & 45 deletions tests/test_twisted/test_yield_return_statement.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/usr/bin/env python

import sys
import unittest

import dlint

IS_PYTHON_3_6 = sys.version_info >= (3, 6)


class TestYieldReturnStatement(dlint.test.base.BaseTest):

Expand Down Expand Up @@ -94,13 +91,7 @@ def func(arg):
linter.visit(python_node)

result = linter.get_results()
expected = [] if IS_PYTHON_3_6 else [
dlint.linters.base.Flake8Result(
lineno=6,
col_offset=4,
message=dlint.linters.YieldReturnStatementLinter._error_tmpl
)
]
expected = []

assert result == expected

Expand Down Expand Up @@ -138,13 +129,7 @@ def func(arg):
linter.visit(python_node)

result = linter.get_results()
expected = [] if IS_PYTHON_3_6 else [
dlint.linters.base.Flake8Result(
lineno=6,
col_offset=4,
message=dlint.linters.YieldReturnStatementLinter._error_tmpl
)
]
expected = []

assert result == expected

Expand All @@ -169,13 +154,7 @@ def func(arg):
linter.visit(python_node)

result = linter.get_results()
expected = [] if IS_PYTHON_3_6 else [
dlint.linters.base.Flake8Result(
lineno=12,
col_offset=8,
message=dlint.linters.YieldReturnStatementLinter._error_tmpl
)
]
expected = []

assert result == expected

Expand Down Expand Up @@ -225,13 +204,7 @@ def inner_func():
linter.visit(python_node)

result = linter.get_results()
expected = [] if IS_PYTHON_3_6 else [
dlint.linters.base.Flake8Result(
lineno=10,
col_offset=8,
message=dlint.linters.YieldReturnStatementLinter._error_tmpl
)
]
expected = []

assert result == expected

Expand Down Expand Up @@ -276,13 +249,7 @@ def func(arg):
linter.visit(python_node)

result = linter.get_results()
expected = [] if IS_PYTHON_3_6 else [
dlint.linters.base.Flake8Result(
lineno=6,
col_offset=4,
message=dlint.linters.YieldReturnStatementLinter._error_tmpl
)
]
expected = []

assert result == expected

Expand All @@ -301,13 +268,7 @@ def func(arg):
linter.visit(python_node)

result = linter.get_results()
expected = [] if IS_PYTHON_3_6 else [
dlint.linters.base.Flake8Result(
lineno=6,
col_offset=4,
message=dlint.linters.YieldReturnStatementLinter._error_tmpl
)
]
expected = []

assert result == expected

Expand Down

0 comments on commit d05a692

Please sign in to comment.