- Notifications
You must be signed in to change notification settings - Fork5.7k
Type hinting#1920
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Type hinting#1920
Changes fromall commits
Commits
Show all changes
54 commits Select commitHold shift + click to select a range
79a76f6
adding mypy to the repo
Poolitzer22a45a0
first take on only testing changed files
Poolitzerf61fecf
allowing test branch
Poolitzer1e94485
improving start condition of workflow
Poolitzer6a51275
Add mypy to pre-commit and make
Bibo-Joshia89828a
Try computing typing coverage in CI
Bibo-Joshi656c2bd
Save coverage report as artifact
Bibo-Joshie5f5867
Drop py3.5, use mypy options instead of diff-cover
Bibo-Joshic856bbb
use spaces over tabs in makefile
Bibo-Joshi783e5d4
Remove deprecated getargspec
Bibo-Joshie13bb33
Refactor de_json
Bibo-Joshi9160674
Annotate all the things! (Except tg.ext)
Bibo-Joshid84444b
Merge branch 'master' into type_hinting_master
Bibo-Joshi7f4410d
Annotate InputMedia, Custom Aliases, improve file typing
Bibo-Joshif87fa10
Move de_list to TelegramObject
Bibo-Joshi4b9c010
Persistence & Handlers
Bibo-Joshi1a22799
Filters
Bibo-Joshi9a545be
JobQueue & Job
Bibo-Joshibe15033
Dispatcher
Bibo-Joshidb78e06
MessageQueue
Bibo-Joshib74d0db
Some fixes
Bibo-Joshif0c972e
Merge branch 'master' into type_hinting_master
Bibo-Joshi84e49a6
utils.typing -> utils.types + 2 newlines
Bibo-Joshia8895a2
Merge branch 'v13' into type_hinting_master
Bibo-Joshi773430d
Temporarily enable tests for the v13 branch
Bibo-Joshi6fd3d2f
Refactor handling of kwargs in Bot methods (#1924)
Bibo-Joshi9c38dae
Refactor JobQueue (#1981)
Bibo-Joshi3418ba2
Refactor persistence of Bot instances (#1994)
Bibo-Joshi1e29c1a
Extend rich comparison of objects (#1724)
Bibo-Joshieb8d65b
Merge branch 'v13' into type_hinting_master
Bibo-Joshidee672d
Temporarily enable tests for the v13 branch
Bibo-Joshi02b058c
Refactor handling of kwargs in Bot methods (#1924)
Bibo-Joshi958a41e
Refactor JobQueue (#1981)
Bibo-Joshic3a426a
Refactor persistence of Bot instances (#1994)
Bibo-Joshife9370a
Extend rich comparison of objects (#1724)
Bibo-Joshif74be43
Refactor handling of default_quote (#1965)
Bibo-Joshi87a426e
Refactor Handling of Message VS Update Filters (#2032)
Bibo-Joshiad30a8f
Make context-based callbacks the default setting (#2050)
Bibo-Joshi2a67404
Merge branch 'v13' into type_hinting_master
Bibo-Joshi9fb50f3
Temporarily enable tests for the v13 branch
Bibo-Joshi274f6b4
Refactor handling of kwargs in Bot methods (#1924)
Bibo-Joshi295805b
Refactor JobQueue (#1981)
Bibo-Joshi75ca2ba
Refactor persistence of Bot instances (#1994)
Bibo-Joshi47bde49
Extend rich comparison of objects (#1724)
Bibo-Joshic7c9790
Refactor handling of default_quote (#1965)
Bibo-Joshida98330
Refactor Handling of Message VS Update Filters (#2032)
Bibo-Joshi85c6831
Make context-based callbacks the default setting (#2050)
Bibo-Joshib090050
Merge branch 'v13' into type_hinting_master
Bibo-Joshif39dbd6
Merge branch 'v13' into type_hinting_master
Bibo-Joshib72ac15
address review
Bibo-Joshi0ad6649
Merge branch 'v13' into type_hinting_master
Bibo-Joshi96b929f
Use NoReturn where possible
Bibo-Joshi4398205
Try ignoring the if TYPE_CHECKING lines in coverage report
Bibo-Joshi6edc522
minor fix
Bibo-JoshiFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 5 additions & 1 deletion.github/CONTRIBUTING.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -46,6 +46,7 @@ htmlcov/ | ||
.coverage.* | ||
.cache | ||
.pytest_cache | ||
.mypy_cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
7 changes: 6 additions & 1 deletion.pre-commit-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletionsMakefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsdocs/source/telegram.utils.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -6,3 +6,4 @@ telegram.utils package | ||
telegram.utils.helpers | ||
telegram.utils.promise | ||
telegram.utils.request | ||
telegram.utils.types |
6 changes: 6 additions & 0 deletionsdocs/source/telegram.utils.types.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
telegram.utils.types Module | ||
=========================== | ||
.. automodule:: telegram.utils.types | ||
:members: | ||
:show-inheritance: |
1 change: 1 addition & 0 deletionsrequirements-dev.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,6 +3,7 @@ pep257 | ||
pylint | ||
flaky | ||
yapf | ||
mypy==0.770 | ||
pre-commit | ||
beautifulsoup4 | ||
pytest==4.2.0 | ||
19 changes: 19 additions & 0 deletionssetup.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiontelegram/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -104,7 +104,6 @@ | ||
from .update import Update | ||
from .files.inputmedia import (InputMedia, InputMediaVideo, InputMediaPhoto, InputMediaAnimation, | ||
InputMediaAudio, InputMediaDocument) | ||
from .constants import (MAX_MESSAGE_LENGTH, MAX_CAPTION_LENGTH, SUPPORTED_WEBHOOK_PORTS, | ||
MAX_FILESIZE_DOWNLOAD, MAX_FILESIZE_UPLOAD, | ||
MAX_MESSAGES_PER_SECOND_PER_CHAT, MAX_MESSAGES_PER_SECOND, | ||
@@ -124,6 +123,7 @@ | ||
SecureData, | ||
FileCredentials, | ||
TelegramDecryptionError) | ||
from .bot import Bot | ||
Bibo-Joshi marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
from .version import __version__ # noqa: F401 | ||
__author__ = 'devs@python-telegram-bot.org' | ||
9 changes: 5 additions & 4 deletionstelegram/__main__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -21,11 +21,12 @@ | ||
import certifi | ||
from typing import Optional | ||
Bibo-Joshi marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
from . import __version__ as telegram_ver | ||
def _git_revision() -> Optional[str]: | ||
try: | ||
output = subprocess.check_output(["git", "describe", "--long", "--tags"], | ||
stderr=subprocess.STDOUT) | ||
@@ -34,15 +35,15 @@ def _git_revision(): | ||
return output.decode().strip() | ||
def print_ver_info() -> None: | ||
git_revision = _git_revision() | ||
print('python-telegram-bot {}'.format(telegram_ver) + (' ({})'.format(git_revision) | ||
if git_revision else '')) | ||
print('certifi {}'.format(certifi.__version__)) # type: ignore[attr-defined] | ||
print('Python {}'.format(sys.version.replace('\n', ' '))) | ||
def main() -> None: | ||
print_ver_info() | ||
52 changes: 40 additions & 12 deletionstelegram/base.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.