diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 66f238df..423ebde0 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -6,5 +6,5 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: psf/black@stable diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 040d5eb8..bb65c146 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c37c20ec..761864f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,9 +13,9 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} cache: 'pip' @@ -27,7 +27,7 @@ jobs: run: | python -m pytest --cov -v - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 + uses: codecov/codecov-action@v7 with: token: ${{ secrets.CODECOV_TOKEN }} slug: python-rope/rope diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index f5c3b8ac..6a9b4c2c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -11,9 +11,9 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: '3.9' - name: Install dependencies diff --git a/docs/conf.py b/docs/conf.py index 0d322e45..6eca8025 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -66,3 +66,6 @@ # Make sure the target is unique autosectionlabel_prefix_document = True + +# suppress third-party generated warnings +suppress_warnings = ["docutils"] diff --git a/docs/configuration.rst b/docs/configuration.rst index 7b336208..a62b4afb 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -70,7 +70,7 @@ autoimport.* Options .. autopytoolconfigtable:: rope.base.prefs.AutoimportPrefs imports.* Options ----------------- +----------------- .. autopytoolconfigtable:: rope.base.prefs.ImportPrefs diff --git a/docs/overview.rst b/docs/overview.rst index b9422ccd..01076ade 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -400,7 +400,7 @@ Extract Method In these examples ``${region_start}`` and ``${region_end}`` show the selected region for extraction: -.. code-block:: python +.. code-block:: none def a_func(): a = 1 @@ -421,7 +421,7 @@ After performing extract method we'll have: For multi-line extractions if we have: -.. code-block:: python +.. code-block:: none def a_func(): a = 1 @@ -1265,7 +1265,7 @@ After running ``mod1`` either SOA or DOA on this module you can test: ``mod2.py``: -.. code-block:: python +.. code-block:: none import mod1 diff --git a/rope/base/ast.py b/rope/base/ast.py index 16c44da4..cc376e0b 100644 --- a/rope/base/ast.py +++ b/rope/base/ast.py @@ -6,7 +6,7 @@ try: # Suppress the mypy complaint: Module "ast" has no attribute "_const_node_type_names" - from ast import _const_node_type_names # type:ignore + from ast import _const_node_type_names # type: ignore except ImportError: # backported from stdlib `ast` assert sys.version_info < (3, 8) or sys.version_info >= (3, 14) diff --git a/rope/base/fscommands.py b/rope/base/fscommands.py index a6104448..36514312 100644 --- a/rope/base/fscommands.py +++ b/rope/base/fscommands.py @@ -65,7 +65,7 @@ def read(self, path): class SubversionCommands: def __init__(self, *args): self.normal_actions = FileSystemCommands() - import pysvn # type:ignore + import pysvn # type: ignore self.client = pysvn.Client() @@ -115,9 +115,9 @@ def __init__(self, root): self.repo = self.hg.hg.repository(self.ui, root) def _import_mercurial(self): - import mercurial.commands # type:ignore - import mercurial.hg # type:ignore - import mercurial.ui # type:ignore + import mercurial.commands # type: ignore + import mercurial.hg # type: ignore + import mercurial.ui # type: ignore return mercurial diff --git a/rope/base/oi/doa.py b/rope/base/oi/doa.py index 82958ce3..1a8a92c7 100644 --- a/rope/base/oi/doa.py +++ b/rope/base/oi/doa.py @@ -4,9 +4,9 @@ import hmac try: - import cPickle as pickle # type:ignore + import cPickle as pickle # type: ignore except ImportError: - import pickle # type:ignore + import pickle # type: ignore import marshal import os import socket diff --git a/rope/base/oi/runmod.py b/rope/base/oi/runmod.py index 3bb7c139..fc6bc90c 100644 --- a/rope/base/oi/runmod.py +++ b/rope/base/oi/runmod.py @@ -4,7 +4,7 @@ def __rope_start_everything(): import sys try: - import cPickle as pickle # type:ignore + import cPickle as pickle # type: ignore except ImportError: import pickle import base64 diff --git a/rope/base/oi/type_hinting/evaluate.py b/rope/base/oi/type_hinting/evaluate.py index acf04bdc..e99310a3 100644 --- a/rope/base/oi/type_hinting/evaluate.py +++ b/rope/base/oi/type_hinting/evaluate.py @@ -69,7 +69,7 @@ class S(SymbolBase): s.lbp = max(bp, s.lbp) return s - @multi # type:ignore + @multi # type: ignore def infix(self, name, bp): symbol = self.symbol(name, bp) @@ -79,7 +79,7 @@ def led(self, left, parser): self.second = parser.expression(bp) return self - @multi # type:ignore + @multi # type: ignore def infix_r(self, name, bp): symbol = self.symbol(name, bp) @@ -101,8 +101,8 @@ def led(self, left, parser): self.third = parser.expression(symbol2.lbp + 0.1) return self - @multi # type:ignore - def prefix(self, name, bp): # type:ignore + @multi # type: ignore + def prefix(self, name, bp): # type: ignore symbol = self.symbol(name, bp) @method(symbol) @@ -110,7 +110,7 @@ def nud(self, parser): self.first = parser.expression(bp) return self - @multi # type:ignore + @multi # type: ignore def postfix(self, name, bp): symbol = self.symbol(name, bp) @@ -237,18 +237,18 @@ def bind(fn): symbol("(end)") -@method(symbol("(name)")) # type:ignore +@method(symbol("(name)")) # type: ignore def nud(self, parser): return self -@method(symbol("(name)")) # type:ignore +@method(symbol("(name)")) # type: ignore def evaluate(self, pyobject): return utils.resolve_type(self.value, pyobject) # Parametrized objects -@method(symbol("[")) # type:ignore +@method(symbol("[")) # type: ignore def led(self, left, parser): self.first = left self.second = [] @@ -264,7 +264,7 @@ def led(self, left, parser): return self -@method(symbol("[")) # type:ignore +@method(symbol("[")) # type: ignore def evaluate(self, pyobject): return utils.parametrize_type( self.first.evaluate(pyobject), *[i.evaluate(pyobject) for i in self.second] @@ -272,7 +272,7 @@ def evaluate(self, pyobject): # Anonymous Function Calls -@method(symbol("(")) # type:ignore +@method(symbol("(")) # type: ignore def nud(self, parser): self.second = [] if parser.token.name != ")": @@ -288,7 +288,7 @@ def nud(self, parser): # Function Calls -@method(symbol("(")) # type:ignore +@method(symbol("(")) # type: ignore def led(self, left, parser): self.first = left self.second = [] @@ -304,13 +304,13 @@ def led(self, left, parser): return self -@method(symbol("(")) # type:ignore +@method(symbol("(")) # type: ignore def evaluate(self, pyobject): # TODO: Implement me raise NotImplementedError -@method(symbol("or")) # type:ignore +@method(symbol("or")) # type: ignore @method(symbol("|")) def evaluate(self, pyobject): # TODO: Implement me diff --git a/rope/base/oi/type_hinting/providers/numpydocstrings.py b/rope/base/oi/type_hinting/providers/numpydocstrings.py index 1bd15b98..93583b79 100644 --- a/rope/base/oi/type_hinting/providers/numpydocstrings.py +++ b/rope/base/oi/type_hinting/providers/numpydocstrings.py @@ -10,7 +10,7 @@ from rope.base.oi.type_hinting.providers import docstrings try: - from numpydoc.docscrape import NumpyDocString # type:ignore + from numpydoc.docscrape import NumpyDocString # type: ignore except ImportError: NumpyDocString = None @@ -41,4 +41,4 @@ def __call__(self, docstring, param_name): if not NumpyDocString: - NumPyDocstringParamParser = _DummyParamParser # type:ignore + NumPyDocstringParamParser = _DummyParamParser # type: ignore diff --git a/rope/base/project.py b/rope/base/project.py index 84ea237d..ea19722a 100644 --- a/rope/base/project.py +++ b/rope/base/project.py @@ -15,13 +15,13 @@ # At present rope.base.prefs starts with `# type:ignore`. # As a result, mypy knows nothing about Prefs and get_config. -from rope.base.prefs import Prefs, get_config # type:ignore +from rope.base.prefs import Prefs, get_config # type: ignore from rope.base.resources import File, Folder, _ResourceMatcher try: - import cPickle as pickle # type:ignore + import cPickle as pickle # type: ignore except ImportError: - import pickle # type:ignore + import pickle # type: ignore class _Project: diff --git a/rope/contrib/autoimport/sqlite.py b/rope/contrib/autoimport/sqlite.py index f06fdaca..88058786 100644 --- a/rope/contrib/autoimport/sqlite.py +++ b/rope/contrib/autoimport/sqlite.py @@ -51,7 +51,6 @@ ) from rope.refactor import importutils - if TYPE_CHECKING: from collections.abc import Collection diff --git a/rope/refactor/move.py b/rope/refactor/move.py index 35db68a7..f13aca6d 100644 --- a/rope/refactor/move.py +++ b/rope/refactor/move.py @@ -336,10 +336,10 @@ def get_changes( if dest is None or not dest.exists(): raise exceptions.RefactoringError("Move destination does not exist.") if dest.is_folder() and dest.has_child("__init__.py"): # type: ignore[attr-defined] - dest = dest.get_child("__init__.py") # type:ignore + dest = dest.get_child("__init__.py") # type: ignore # The previous guards protect against this mypy complaint: # Item "None" of "Union[str, Resource, None]" has no attribute "is_folder" - if dest.is_folder(): # type:ignore + if dest.is_folder(): # type: ignore raise exceptions.RefactoringError( "Move destination for non-modules should not be folders." )