Skip to content

Commit

Permalink
Disable jedi tests on Python 3.13 until supported by jedi
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Mar 5, 2024
1 parent 9ce8ed2 commit 46fe2de
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
10 changes: 5 additions & 5 deletions flake8_encodings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def visit_Call(self, node: ast.Call) -> None: # noqa: D102
self.generic_visit(node)


class ClassVisitor(Visitor):
class ClassVisitor(Visitor): # pragma: no cover (py313+)
"""
AST visitor to identify incorrect use of encodings,
with support for :class:`pathlib.Path` and :class:`configparser.ConfigParser`.
Expand Down Expand Up @@ -361,7 +361,7 @@ def __init__(self, tree: ast.AST, filename: PathLike):

def run(self) -> Iterator[Tuple[int, int, str, Type["Plugin"]]]: # noqa: D102

try:
try: # pragma: no cover (py313+)
# 3rd party
import jedi

Expand All @@ -388,7 +388,7 @@ def run(self) -> Iterator[Tuple[int, int, str, Type["Plugin"]]]: # noqa: D102
yield line, col, msg, type(self)


def is_configparser_read(class_name: str, method_name: str) -> bool:
def is_configparser_read(class_name: str, method_name: str) -> bool: # pragma: no cover (py313+)
"""
Returns :py:obj:`True` if method is :meth:`configparser.ConfigParser.read` or
:meth:`configparser.RawConfigParser.read`.
Expand All @@ -408,7 +408,7 @@ def is_configparser_read(class_name: str, method_name: str) -> bool:
return True


def is_pathlib_method(class_name: str, method_name: str) -> bool:
def is_pathlib_method(class_name: str, method_name: str) -> bool: # pragma: no cover (py313+)
"""
Returns :py:obj:`True` if method is :meth:`pathlib.Path.open`,
:meth:`read_text() <pathlib.Path.read_text>` or :meth:`write_text() <pathlib.Path.write_text>`.
Expand All @@ -428,7 +428,7 @@ def is_pathlib_method(class_name: str, method_name: str) -> bool:
return True


def get_inferred_types(jedi_script: "Script", node: ast.Call) -> List[str]:
def get_inferred_types(jedi_script: "Script", node: ast.Call) -> List[str]: # pragma: no cover (py313+)
"""
Returns a list of types inferred by ``jedi`` for the given call node.
Expand Down
1 change: 1 addition & 0 deletions repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ extras_require:

tox_unmanaged:
- testenv
- testenv:py313-dev

exclude_files:
- contributing
15 changes: 9 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# * tox
# * envlists
# * testenv:.package
# * testenv:py313-dev
# * testenv:py312-dev
# * testenv:py312
# * testenv:docs
Expand Down Expand Up @@ -65,11 +64,6 @@ setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1

[testenv:py313-dev]
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1

[testenv:py312]
setenv =
PYTHONDEVMODE=1
Expand Down Expand Up @@ -231,6 +225,15 @@ filterwarnings =
error
ignore:can't resolve package from __spec__ or __package__, falling back on __name__ and __path__:ImportWarning
[testenv:py313-dev]
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1
commands =
python --version
python -m pip uninstall jedi -y
python -m pytest --cov=flake8_encodings -r aR tests/ --cov-append {posargs}
[testenv]
setenv =
PYTHONDEVMODE=1
Expand Down

0 comments on commit 46fe2de

Please sign in to comment.