Skip to content

Fix failing pylint locally #2748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 30, 2021
Merged
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# * the additional_dependencies here match requirements.txt
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 21.9b0
hooks:
- id: black
args:
- --diff
- --check
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/PyCQA/pylint
rev: v2.10.2
rev: v2.11.1
hooks:
- id: pylint
files: ^(telegram|examples)/.*\.py$
Expand Down Expand Up @@ -56,7 +56,7 @@ repos:
- cachetools==4.2.2
- . # this basically does `pip install -e .`
- repo: https://github.com/asottile/pyupgrade
rev: v2.24.0
rev: v2.29.0
hooks:
- id: pyupgrade
files: ^(telegram|examples|tests)/.*\.py$
Expand Down
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ cryptography!=3.4,!=3.4.1,!=3.4.2,!=3.4.3

pre-commit
# Make sure that the versions specified here match the pre-commit settings!
black==20.8b1
flake8==3.9.2
pylint==2.10.2
black==21.9b0
flake8==4.0.1
pylint==2.11.1
mypy==0.910
pyupgrade==2.24.0
pyupgrade==2.29.0

pytest==6.2.4
pytest==6.2.5

flaky
beautifulsoup4
Expand Down
4 changes: 1 addition & 3 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2259,9 +2259,7 @@ def get_file(
if result.get('file_path') and not is_local_file( # type: ignore[union-attr]
result['file_path'] # type: ignore[index]
):
result['file_path'] = '{}/{}'.format( # type: ignore[index]
self.base_file_url, result['file_path'] # type: ignore[index]
)
result['file_path'] = f"{self.base_file_url}/{result['file_path']}" # type: ignore

return File.de_json(result, self) # type: ignore[return-value, arg-type]

Expand Down
2 changes: 1 addition & 1 deletion telegram/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, message: str):
self.message = msg

def __str__(self) -> str:
return '%s' % self.message
return self.message

def __reduce__(self) -> Tuple[type, Tuple[str]]:
return self.__class__, (self.message,)
Expand Down
1 change: 0 additions & 1 deletion telegram/ext/_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
# the UpdaterBuilder has all method that the DispatcherBuilder has
class _BaseBuilder(Generic[ODT, BT, CCT, UD, CD, BD, JQ, PT]):
# pylint reports false positives here:
# pylint: disable=unused-private-member

__slots__ = (
'_token',
Expand Down
4 changes: 2 additions & 2 deletions telegram/ext/_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
from telegram.ext._utils.stack import was_called_by

if TYPE_CHECKING:
from .jobqueue import Job
from .builders import InitDispatcherBuilder
from telegram.ext._jobqueue import Job
from telegram.ext._builders import InitDispatcherBuilder

DEFAULT_GROUP: int = 0

Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from telegram.ext._utils.types import BT

if TYPE_CHECKING:
from .builders import InitUpdaterBuilder
from telegram.ext._builders import InitUpdaterBuilder


DT = TypeVar('DT', bound=Union[None, Dispatcher])
Expand Down
1 change: 1 addition & 0 deletions telegram/ext/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,7 @@ def filter(self, message: Message) -> bool:

class _Dice(_DiceEmoji):
__slots__ = ()
# pylint: disable=no-member
dice = _DiceEmoji(DiceEmoji.DICE, DiceEmoji.DICE.name.lower())
darts = _DiceEmoji(DiceEmoji.DARTS, DiceEmoji.DARTS.name.lower())
basketball = _DiceEmoji(DiceEmoji.BASKETBALL, DiceEmoji.BASKETBALL.name.lower())
Expand Down