Adjust pre-commit Settings for isort (#3043)

This commit is contained in:
Bibo-Joshi 2022-05-18 17:23:00 +02:00 committed by GitHub
parent 076955d04d
commit d2cabcaa74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 11 deletions

View file

@ -74,4 +74,6 @@ repos:
hooks:
- id: isort
name: isort
args: ["--diff"] # -diff will not apply the changes, just show them
args:
- --diff
- --check

View file

@ -175,6 +175,7 @@ __all__ = ( # Keep this alphabetically ordered
)
from . import _version
from ._bot import Bot
from ._botcommand import BotCommand
from ._botcommandscope import (
@ -311,7 +312,6 @@ from ._telegramobject import TelegramObject
from ._update import Update
from ._user import User
from ._userprofilephotos import UserProfilePhotos
from . import _version
#: :obj:`str`: The version of the `python-telegram-bot` library as string.
#: To get detailed information about the version number, please use :data:`__version_info__`

View file

@ -24,11 +24,16 @@ Warning:
the changelog.
"""
from pathlib import Path
from typing import IO, TYPE_CHECKING, Any, Dict, Optional, Tuple, TypeVar, Union, Collection
from typing import IO, TYPE_CHECKING, Any, Collection, Dict, Optional, Tuple, TypeVar, Union
if TYPE_CHECKING:
from telegram import InputFile
from telegram import ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram import (
ForceReply,
InlineKeyboardMarkup,
InputFile,
ReplyKeyboardMarkup,
ReplyKeyboardRemove,
)
from telegram._utils.defaultvalue import DefaultValue
FileLike = Union[IO[bytes], "InputFile"]

View file

@ -34,7 +34,7 @@ from telegram.request import BaseRequest
from telegram.request._httpxrequest import HTTPXRequest
if TYPE_CHECKING:
from telegram.ext import BasePersistence, Defaults, CallbackContext
from telegram.ext import BasePersistence, CallbackContext, Defaults
# Type hinting is a bit complicated here because we try to get to a sane level of
# leveraging generics and therefore need a number of type variables.

View file

@ -24,6 +24,7 @@ from telegram.ext._utils.types import BD, CCT, CD, UD
if TYPE_CHECKING:
from typing import Dict
from telegram.ext._extbot import ExtBot

View file

@ -40,11 +40,11 @@ from telegram.ext import (
Application,
ApplicationBuilder,
ApplicationHandlerStop,
BaseHandler,
CallbackContext,
CommandHandler,
ContextTypes,
Defaults,
BaseHandler,
JobQueue,
MessageHandler,
PicklePersistence,

View file

@ -34,10 +34,10 @@ from telegram.ext import (
Application,
ApplicationBuilder,
ApplicationHandlerStop,
BaseHandler,
BasePersistence,
CallbackContext,
ConversationHandler,
BaseHandler,
MessageHandler,
PersistenceInput,
filters,

View file

@ -19,10 +19,10 @@
import pytest
from telegram import (
__version_info__,
__version__,
__bot_api_version_info__,
__bot_api_version__,
__bot_api_version_info__,
__version__,
__version_info__,
constants,
)
from telegram._version import Version