Skip to content

Rename private modules with leading underscore #2687

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 46 commits into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
331c4f5
Temporarily enable tests for the v14 branch
Bibo-Joshi Jul 14, 2021
9dc30cf
Move and Rename TelegramDecryptionError to telegram.error.PassportDec…
harshil21 Aug 11, 2021
b089cc9
Add Code Comment Guidelines to Contribution Guide (#2612)
Poolitzer Aug 11, 2021
3a19383
Improve Type Hinting for CallbackContext (#2587)
revolter Aug 12, 2021
414a18c
Add Custom pytest Marker to Ease Development (#2628)
Poolitzer Aug 12, 2021
8edb49d
Make BasePersistence Methods Abstract (#2624)
starry-shivam Aug 12, 2021
cce9c18
Refactor Initialization of Persistence Classes (#2604)
Bibo-Joshi Aug 13, 2021
dc0207a
Remove `__dict__` from `__slots__` and drop Python 3.6 (#2619, #2636)
harshil21 Aug 19, 2021
4af252f
Remove day_is_strict argument of JobQueue.run_monthly (#2634)
iota-008 Aug 26, 2021
b6e4b54
Drop Non-CallbackContext API (#2617)
Poolitzer Aug 29, 2021
4359812
Fix Signatures and Improve test_official (#2643)
harshil21 Aug 29, 2021
dbdd35e
Remove Deprecated Functionality (#2644)
Bibo-Joshi Aug 30, 2021
a7c7c82
Add User Friendly Type Check For Init Of {Inline, Reply}KeyboardMarku…
harshil21 Sep 15, 2021
8ac65fc
Refine Dispatcher.dispatch_error (#2660)
Bibo-Joshi Sep 17, 2021
66f0604
Warnings Overhaul (#2662)
harshil21 Sep 20, 2021
4f21c06
Clear Up Import Policy (#2671)
Bibo-Joshi Sep 22, 2021
5542a46
Make InlineQuery.answer Raise ValueError (#2675)
Bibo-Joshi Sep 24, 2021
8bf8bbd
Rename most private modules with a leading underscore
Oct 1, 2021
e9b54df
Rename all private modules with leading underscore
Oct 1, 2021
0962e45
Rename private modules in telegram.ext with leading underscore
Oct 2, 2021
b2b074d
Rename private submodules with leading underscore
Oct 4, 2021
7e2ee91
Rename tg(.ext).utils with leading underscore
Oct 4, 2021
47ab725
Minor fix in AUTHORS.rst
Oct 4, 2021
f50f36a
Minor fixes
Oct 5, 2021
d09bfd5
Removed (.ext).utils from the docs
Oct 5, 2021
421f706
Rename most private modules with a leading underscore
Oct 1, 2021
ce92fb0
Rename all private modules with leading underscore
Oct 1, 2021
ee3b767
Rename private modules in telegram.ext with leading underscore
Oct 2, 2021
ca7e874
Rename private submodules with leading underscore
Oct 4, 2021
45ece57
Rename tg(.ext).utils with leading underscore
Oct 4, 2021
cbfe5e9
Minor fix in AUTHORS.rst
Oct 4, 2021
e4cda2a
Minor fixes
Oct 5, 2021
dafd9b0
Removed (.ext).utils from the docs
Oct 5, 2021
6e9ed45
solve remaining merge conflicts and fine tune imports
Bibo-Joshi Oct 5, 2021
3a92794
Merge branch 'v14' into private-modules
Bibo-Joshi Oct 5, 2021
55ec95d
Revert relative imports
Bibo-Joshi Oct 5, 2021
4d3c26c
Fix indention
Bibo-Joshi Oct 5, 2021
4de323a
Merge remote-tracking branch 'origin/private-modules' into private-mo…
Oct 7, 2021
e76639b
Remove mentions of contents in (ext)._utils from documentation
Oct 9, 2021
7db65b0
Minor fixes to formatting in documentation
Oct 9, 2021
b7bb161
More minor fixes to documentation
Oct 9, 2021
2add52b
Minor fix to documentation
Oct 10, 2021
3a66a77
Fix minor typo in ext.basepersistence.py
Oct 10, 2021
bba75ef
Merge branch 'v14' into private-modules & adapt for Builder changes
Bibo-Joshi Oct 10, 2021
18308bd
Fix tests
Bibo-Joshi Oct 10, 2021
fc284e8
Some last fine tuning
Bibo-Joshi Oct 10, 2021
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/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Here's how to make a one-off code change.

- Your code should adhere to the `PEP 8 Style Guide`_, with the exception that we have a maximum line length of 99.

- Provide static typing with signature annotations. The documentation of `MyPy`_ will be a good start, the cheat sheet is `here`_. We also have some custom type aliases in ``telegram.utils.helpers.typing``.
- Provide static typing with signature annotations. The documentation of `MyPy`_ will be a good start, the cheat sheet is `here`_. We also have some custom type aliases in ``telegram._utils.types``.

- Document your code. This step is pretty important to us, so it has its own `section`_.

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ target/
# Sublime Text 2
*.sublime*

# VS Code
.vscode

# unitests files
game.gif
telegram.mp3
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ The following wonderful people contributed directly or indirectly to this projec
- `Joscha Götzer <https://github.com/Rostgnom>`_
- `jossalgon <https://github.com/jossalgon>`_
- `JRoot3D <https://github.com/JRoot3D>`_
- `kennethcheo <https://github.com/kennethcheo>`_
- `Kirill Vasin <https://github.com/vasinkd>`_
- `Kjwon15 <https://github.com/kjwon15>`_
- `Li-aung Yip <https://github.com/LiaungYip>`_
Expand Down
9 changes: 0 additions & 9 deletions docs/source/telegram.ext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,3 @@ Arbitrary Callback Data

telegram.ext.callbackdatacache
telegram.ext.invalidcallbackdata

utils
-----

.. toctree::

telegram.ext.utils.promise
telegram.ext.utils.stack
telegram.ext.utils.types
8 changes: 0 additions & 8 deletions docs/source/telegram.ext.utils.promise.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/telegram.ext.utils.types.rst

This file was deleted.

11 changes: 0 additions & 11 deletions docs/source/telegram.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,3 @@ Auxiliary modules
telegram.helpers
telegram.request
telegram.warnings

utils
-----

.. toctree::

telegram.utils.datetime
telegram.utils.defaultvalue
telegram.utils.files
telegram.utils.types
telegram.utils.warnings
8 changes: 0 additions & 8 deletions docs/source/telegram.utils.datetime.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/telegram.utils.defaultvalue.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/telegram.utils.files.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/telegram.utils.types.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/telegram.utils.warnings.rst

This file was deleted.

4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ ignore_errors = True

# Disable strict optional for telegram objects with class methods
# We don't want to clutter the code with 'if self.bot is None: raise RuntimeError()'
[mypy-telegram.callbackquery,telegram.chat,telegram.message,telegram.user,telegram.files.*,telegram.inline.inlinequery,telegram.payment.precheckoutquery,telegram.payment.shippingquery,telegram.passport.passportdata,telegram.passport.credentials,telegram.passport.passportfile,telegram.ext.filters]
[mypy-telegram._callbackquery,telegram._chat,telegram._message,telegram._user,telegram._files.*,telegram._inline.inlinequery,telegram._payment.precheckoutquery,telegram._payment.shippingquery,telegram._passport.passportdata,telegram._passport.credentials,telegram._passport.passportfile,telegram.ext.filters]
strict_optional = False

# type hinting for asyncio in webhookhandler is a bit tricky because it depends on the OS
[mypy-telegram.ext.utils.webhookhandler]
[mypy-telegram.ext._utils.webhookhandler]
warn_unused_ignores = False

[mypy-urllib3.*]
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_setup_kwargs(raw=False):
raw_ext = "-raw" if raw else ""
readme = Path(f'README{"_RAW" if raw else ""}.rst')

with Path('telegram/version.py').open() as fh:
with Path('telegram/_version.py').open() as fh:
for line in fh.readlines():
if line.startswith('__version__'):
exec(line)
Expand All @@ -76,7 +76,6 @@ def get_setup_kwargs(raw=False):
long_description=readme.read_text(),
long_description_content_type='text/x-rst',
packages=packages,

install_requires=requirements,
extras_require={
'json': 'ujson',
Expand All @@ -99,7 +98,7 @@ def get_setup_kwargs(raw=False):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
python_requires='>=3.7'
python_requires='>=3.7',
)

return kwargs
Expand Down
194 changes: 97 additions & 97 deletions telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""A library that provides a Python interface to the Telegram Bot API"""

from .telegramobject import TelegramObject
from .botcommand import BotCommand
from .user import User
from .files.chatphoto import ChatPhoto
from .chat import Chat
from .chatlocation import ChatLocation
from .chatinvitelink import ChatInviteLink
from .chatmember import (
from ._telegramobject import TelegramObject
from ._botcommand import BotCommand
from ._user import User
from ._files.chatphoto import ChatPhoto
from ._chat import Chat
from ._chatlocation import ChatLocation
from ._chatinvitelink import ChatInviteLink
from ._chatmember import (
ChatMember,
ChatMemberOwner,
ChatMemberAdministrator,
Expand All @@ -34,103 +34,103 @@
ChatMemberLeft,
ChatMemberBanned,
)
from .chatmemberupdated import ChatMemberUpdated
from .chatpermissions import ChatPermissions
from .files.photosize import PhotoSize
from .files.audio import Audio
from .files.voice import Voice
from .files.document import Document
from .files.animation import Animation
from .files.sticker import Sticker, StickerSet, MaskPosition
from .files.video import Video
from .files.contact import Contact
from .files.location import Location
from .files.venue import Venue
from .files.videonote import VideoNote
from .chataction import ChatAction
from .dice import Dice
from .userprofilephotos import UserProfilePhotos
from .keyboardbuttonpolltype import KeyboardButtonPollType
from .keyboardbutton import KeyboardButton
from .replymarkup import ReplyMarkup
from .replykeyboardmarkup import ReplyKeyboardMarkup
from .replykeyboardremove import ReplyKeyboardRemove
from .forcereply import ForceReply
from .files.inputfile import InputFile
from .files.file import File
from .parsemode import ParseMode
from .messageentity import MessageEntity
from .messageid import MessageId
from .games.game import Game
from .poll import Poll, PollOption, PollAnswer
from .voicechat import (
from ._chatmemberupdated import ChatMemberUpdated
from ._chatpermissions import ChatPermissions
from ._files.photosize import PhotoSize
from ._files.audio import Audio
from ._files.voice import Voice
from ._files.document import Document
from ._files.animation import Animation
from ._files.sticker import Sticker, StickerSet, MaskPosition
from ._files.video import Video
from ._files.contact import Contact
from ._files.location import Location
from ._files.venue import Venue
from ._files.videonote import VideoNote
from ._chataction import ChatAction
from ._dice import Dice
from ._userprofilephotos import UserProfilePhotos
from ._keyboardbuttonpolltype import KeyboardButtonPollType
from ._keyboardbutton import KeyboardButton
from ._replymarkup import ReplyMarkup
from ._replykeyboardmarkup import ReplyKeyboardMarkup
from ._replykeyboardremove import ReplyKeyboardRemove
from ._forcereply import ForceReply
from ._files.inputfile import InputFile
from ._files.file import File
from ._parsemode import ParseMode
from ._messageentity import MessageEntity
from ._messageid import MessageId
from ._games.game import Game
from ._poll import Poll, PollOption, PollAnswer
from ._voicechat import (
VoiceChatStarted,
VoiceChatEnded,
VoiceChatParticipantsInvited,
VoiceChatScheduled,
)
from .loginurl import LoginUrl
from .proximityalerttriggered import ProximityAlertTriggered
from .games.callbackgame import CallbackGame
from .payment.shippingaddress import ShippingAddress
from .payment.orderinfo import OrderInfo
from .payment.successfulpayment import SuccessfulPayment
from .payment.invoice import Invoice
from .passport.credentials import EncryptedCredentials
from .passport.passportfile import PassportFile
from .passport.data import IdDocumentData, PersonalDetails, ResidentialAddress
from .passport.encryptedpassportelement import EncryptedPassportElement
from .passport.passportdata import PassportData
from .inline.inlinekeyboardbutton import InlineKeyboardButton
from .inline.inlinekeyboardmarkup import InlineKeyboardMarkup
from .messageautodeletetimerchanged import MessageAutoDeleteTimerChanged
from .message import Message
from .callbackquery import CallbackQuery
from .choseninlineresult import ChosenInlineResult
from .inline.inputmessagecontent import InputMessageContent
from .inline.inlinequery import InlineQuery
from .inline.inlinequeryresult import InlineQueryResult
from .inline.inlinequeryresultarticle import InlineQueryResultArticle
from .inline.inlinequeryresultaudio import InlineQueryResultAudio
from .inline.inlinequeryresultcachedaudio import InlineQueryResultCachedAudio
from .inline.inlinequeryresultcacheddocument import InlineQueryResultCachedDocument
from .inline.inlinequeryresultcachedgif import InlineQueryResultCachedGif
from .inline.inlinequeryresultcachedmpeg4gif import InlineQueryResultCachedMpeg4Gif
from .inline.inlinequeryresultcachedphoto import InlineQueryResultCachedPhoto
from .inline.inlinequeryresultcachedsticker import InlineQueryResultCachedSticker
from .inline.inlinequeryresultcachedvideo import InlineQueryResultCachedVideo
from .inline.inlinequeryresultcachedvoice import InlineQueryResultCachedVoice
from .inline.inlinequeryresultcontact import InlineQueryResultContact
from .inline.inlinequeryresultdocument import InlineQueryResultDocument
from .inline.inlinequeryresultgif import InlineQueryResultGif
from .inline.inlinequeryresultlocation import InlineQueryResultLocation
from .inline.inlinequeryresultmpeg4gif import InlineQueryResultMpeg4Gif
from .inline.inlinequeryresultphoto import InlineQueryResultPhoto
from .inline.inlinequeryresultvenue import InlineQueryResultVenue
from .inline.inlinequeryresultvideo import InlineQueryResultVideo
from .inline.inlinequeryresultvoice import InlineQueryResultVoice
from .inline.inlinequeryresultgame import InlineQueryResultGame
from .inline.inputtextmessagecontent import InputTextMessageContent
from .inline.inputlocationmessagecontent import InputLocationMessageContent
from .inline.inputvenuemessagecontent import InputVenueMessageContent
from .payment.labeledprice import LabeledPrice
from .inline.inputinvoicemessagecontent import InputInvoiceMessageContent
from .inline.inputcontactmessagecontent import InputContactMessageContent
from .payment.shippingoption import ShippingOption
from .payment.precheckoutquery import PreCheckoutQuery
from .payment.shippingquery import ShippingQuery
from .webhookinfo import WebhookInfo
from .games.gamehighscore import GameHighScore
from .update import Update
from .files.inputmedia import (
from ._loginurl import LoginUrl
from ._proximityalerttriggered import ProximityAlertTriggered
from ._games.callbackgame import CallbackGame
from ._payment.shippingaddress import ShippingAddress
from ._payment.orderinfo import OrderInfo
from ._payment.successfulpayment import SuccessfulPayment
from ._payment.invoice import Invoice
from ._passport.credentials import EncryptedCredentials
from ._passport.passportfile import PassportFile
from ._passport.data import IdDocumentData, PersonalDetails, ResidentialAddress
from ._passport.encryptedpassportelement import EncryptedPassportElement
from ._passport.passportdata import PassportData
from ._inline.inlinekeyboardbutton import InlineKeyboardButton
from ._inline.inlinekeyboardmarkup import InlineKeyboardMarkup
from ._messageautodeletetimerchanged import MessageAutoDeleteTimerChanged
from ._message import Message
from ._callbackquery import CallbackQuery
from ._choseninlineresult import ChosenInlineResult
from ._inline.inputmessagecontent import InputMessageContent
from ._inline.inlinequery import InlineQuery
from ._inline.inlinequeryresult import InlineQueryResult
from ._inline.inlinequeryresultarticle import InlineQueryResultArticle
from ._inline.inlinequeryresultaudio import InlineQueryResultAudio
from ._inline.inlinequeryresultcachedaudio import InlineQueryResultCachedAudio
from ._inline.inlinequeryresultcacheddocument import InlineQueryResultCachedDocument
from ._inline.inlinequeryresultcachedgif import InlineQueryResultCachedGif
from ._inline.inlinequeryresultcachedmpeg4gif import InlineQueryResultCachedMpeg4Gif
from ._inline.inlinequeryresultcachedphoto import InlineQueryResultCachedPhoto
from ._inline.inlinequeryresultcachedsticker import InlineQueryResultCachedSticker
from ._inline.inlinequeryresultcachedvideo import InlineQueryResultCachedVideo
from ._inline.inlinequeryresultcachedvoice import InlineQueryResultCachedVoice
from ._inline.inlinequeryresultcontact import InlineQueryResultContact
from ._inline.inlinequeryresultdocument import InlineQueryResultDocument
from ._inline.inlinequeryresultgif import InlineQueryResultGif
from ._inline.inlinequeryresultlocation import InlineQueryResultLocation
from ._inline.inlinequeryresultmpeg4gif import InlineQueryResultMpeg4Gif
from ._inline.inlinequeryresultphoto import InlineQueryResultPhoto
from ._inline.inlinequeryresultvenue import InlineQueryResultVenue
from ._inline.inlinequeryresultvideo import InlineQueryResultVideo
from ._inline.inlinequeryresultvoice import InlineQueryResultVoice
from ._inline.inlinequeryresultgame import InlineQueryResultGame
from ._inline.inputtextmessagecontent import InputTextMessageContent
from ._inline.inputlocationmessagecontent import InputLocationMessageContent
from ._inline.inputvenuemessagecontent import InputVenueMessageContent
from ._payment.labeledprice import LabeledPrice
from ._inline.inputinvoicemessagecontent import InputInvoiceMessageContent
from ._inline.inputcontactmessagecontent import InputContactMessageContent
from ._payment.shippingoption import ShippingOption
from ._payment.precheckoutquery import PreCheckoutQuery
from ._payment.shippingquery import ShippingQuery
from ._webhookinfo import WebhookInfo
from ._games.gamehighscore import GameHighScore
from ._update import Update
from ._files.inputmedia import (
InputMedia,
InputMediaVideo,
InputMediaPhoto,
InputMediaAnimation,
InputMediaAudio,
InputMediaDocument,
)
from .passport.passportelementerrors import (
from ._passport.passportelementerrors import (
PassportElementError,
PassportElementErrorDataField,
PassportElementErrorFile,
Expand All @@ -142,14 +142,14 @@
PassportElementErrorTranslationFiles,
PassportElementErrorUnspecified,
)
from .passport.credentials import (
from ._passport.credentials import (
Credentials,
DataCredentials,
SecureData,
SecureValue,
FileCredentials,
)
from .botcommandscope import (
from ._botcommandscope import (
BotCommandScope,
BotCommandScopeDefault,
BotCommandScopeAllPrivateChats,
Expand All @@ -159,8 +159,8 @@
BotCommandScopeChatAdministrators,
BotCommandScopeChatMember,
)
from .bot import Bot
from .version import __version__, bot_api_version # noqa: F401
from ._bot import Bot
from ._version import __version__, bot_api_version # noqa: F401

__author__ = 'devs@python-telegram-bot.org'

Expand Down
Loading