Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: psf/black@stable
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@

# Make sure the target is unique
autosectionlabel_prefix_document = True

# suppress third-party generated warnings
suppress_warnings = ["docutils"]
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ autoimport.* Options
.. autopytoolconfigtable:: rope.base.prefs.AutoimportPrefs

imports.* Options
----------------
-----------------

.. autopytoolconfigtable:: rope.base.prefs.ImportPrefs

Expand Down
6 changes: 3 additions & 3 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion rope/base/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions rope/base/fscommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions rope/base/oi/doa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rope/base/oi/runmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions rope/base/oi/type_hinting/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -101,16 +101,16 @@ 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)
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)

Expand Down Expand Up @@ -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 = []
Expand All @@ -264,15 +264,15 @@ 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]
)


# Anonymous Function Calls
@method(symbol("(")) # type:ignore
@method(symbol("(")) # type: ignore
def nud(self, parser):
self.second = []
if parser.token.name != ")":
Expand All @@ -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 = []
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions rope/base/oi/type_hinting/providers/numpydocstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -41,4 +41,4 @@ def __call__(self, docstring, param_name):


if not NumpyDocString:
NumPyDocstringParamParser = _DummyParamParser # type:ignore
NumPyDocstringParamParser = _DummyParamParser # type: ignore
6 changes: 3 additions & 3 deletions rope/base/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion rope/contrib/autoimport/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
)
from rope.refactor import importutils


if TYPE_CHECKING:
from collections.abc import Collection

Expand Down
4 changes: 2 additions & 2 deletions rope/refactor/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down
Loading