Skip to content

Commit

Permalink
Bump version to v21.4 (python-telegram-bot#4371)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibo-Joshi authored Jul 12, 2024
1 parent efe1392 commit 2ac4e00
Show file tree
Hide file tree
Showing 19 changed files with 122 additions and 70 deletions.
52 changes: 52 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,58 @@
Changelog
=========

Version 21.4
============

*Released 2024-07-12*

This is the technical changelog for version 21.4. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel <https://t.me/pythontelegrambotchannel>`_.

Major Changes
-------------

- Full Support for Bot API 7.5 (:pr:`4328`, :pr:`4316`, :pr:`4315`, :pr:`4312` closes :issue:`4310`, :pr:`4311`)
- Full Support for Bot API 7.6 (:pr:`4333` closes :issue:`4331`, :pr:`4344`, :pr:`4341`, :pr:`4334`, :pr:`4335`, :pr:`4351`, :pr:`4342`, :pr:`4348`)
- Full Support for Bot API 7.7 (:pr:`4356` closes :issue:`4355`)
- Drop ``python-telegram-bot-raw`` And Switch to ``pyproject.toml`` Based Packaging (:pr:`4288` closes :issue:`4129` and :issue:`4296`)
- Deprecate Inclusion of ``successful_payment`` in ``Message.effective_attachment`` (:pr:`4365` closes :issue:`4350`)

New Features
------------

- Add Support for Python 3.13 Beta (:pr:`4253`)
- Add ``filters.PAID_MEDIA`` (:pr:`4357`)
- Log Received Data on Deserialization Errors (:pr:`4304`)
- Add ``MessageEntity.adjust_message_entities_to_utf_16`` Utility Function (:pr:`4323` by `Antares0982 <https://github.com/Antares0982>`_ closes :issue:`4319`)
- Make Argument ``bot`` of ``TelegramObject.de_json`` Optional (:pr:`4320`)

Documentation Improvements
--------------------------

- Documentation Improvements (:pr:`4303` closes :issue:`4301`)
- Restructure Readme (:pr:`4362`)
- Fix Link-Check Workflow (:pr:`4332`)

Internal Changes
----------------

- Automate PyPI Releases (:pr:`4364` closes :issue:`4318`)
- Add ``mise-en-place`` to ``.gitignore`` (:pr:`4300`)
- Use a Composite Action for Testing Type Completeness (:pr:`4367`)
- Stabilize Some Concurrency Usages in Test Suite (:pr:`4360`)
- Add a Test Case for ``MenuButton`` (:pr:`4363`)
- Extend ``SuccessfulPayment`` Test (:pr:`4349`)
- Small Fixes for ``test_stars.py`` (:pr:`4347`)
- Use Python 3.13 Beta 3 in Test Suite (:pr:`4336`)

Dependency Updates
------------------

- Bump ``ruff`` and Add New Rules (:pr:`4329`)
- Bump ``pre-commit`` Hooks to Latest Versions (:pr:`4337`)
- Add Lower Bound for ``flaky`` Dependency (:pr:`4322` by `Palaptin <https://github.com/Palaptin>`_)
- Bump ``pytest`` from 8.2.1 to 8.2.2 (:pr:`4294`)

Version 21.3
============
*Released 2024-06-07*
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Verifying Releases

To enable you to verify that a release file that you downloaded was indeed provided by the ``python-telegram-bot`` team, we have taken the following measures.

Starting with NEXT.VERSION, all releases are signed via `sigstore <https://sigstore.dev>`_.
Starting with v21.4, all releases are signed via `sigstore <https://sigstore.dev>`_.
The corresponding signature files are uploaded to the `GitHub releases page`_.
To verify the signature, please install the `sigstore Python client <https://pypi.org/project/sigstore/>`_ and follow the instructions for `verifying signatures from GitHub Actions <https://github.com/sigstore/sigstore-python#signatures-from-github-actions>`_. As input for the ``--repository`` parameter, please use the value ``python-telegram-bot/python-telegram-bot``.

Expand Down
18 changes: 9 additions & 9 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@ async def edit_message_live_location(
.. versionadded:: 21.2.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Keyword Args:
location (:class:`telegram.Location`, optional): The location to send.
Expand Down Expand Up @@ -2932,7 +2932,7 @@ async def stop_message_live_location(
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand Down Expand Up @@ -4006,7 +4006,7 @@ async def edit_message_text(
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Keyword Args:
disable_web_page_preview (:obj:`bool`, optional): Disables link previews for links in
Expand Down Expand Up @@ -4104,7 +4104,7 @@ async def edit_message_caption(
.. versionadded:: 21.3
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand Down Expand Up @@ -4177,7 +4177,7 @@ async def edit_message_media(
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand Down Expand Up @@ -4238,7 +4238,7 @@ async def edit_message_reply_markup(
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand Down Expand Up @@ -7185,7 +7185,7 @@ async def stop_poll(
message inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Returns:
:class:`telegram.Poll`: On success, the stopped Poll is returned.
Expand Down Expand Up @@ -9138,7 +9138,7 @@ async def get_star_transactions(
) -> StarTransactions:
"""Returns the bot's Telegram Star transactions in chronological order.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
offset (:obj:`int`, optional): Number of transactions to skip in the response.
Expand Down Expand Up @@ -9193,7 +9193,7 @@ async def send_paid_media(
) -> Message:
"""Use this method to send paid media to channel chats.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
Expand Down
2 changes: 1 addition & 1 deletion telegram/_botcommandscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def de_json(
bot (:class:`telegram.Bot`, optional): The bot associated with this object. Defaults to
:obj:`None`, in which case shortcut methods will not be available.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
:paramref:`bot` is now optional and defaults to :obj:`None`
Returns:
Expand Down
2 changes: 1 addition & 1 deletion telegram/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ async def send_paid_media(
For the documentation of the arguments, please see
:meth:`telegram.Bot.send_paid_media`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Returns:
:class:`telegram.Message`: On success, instance representing the message posted.
Expand Down
4 changes: 2 additions & 2 deletions telegram/_chatfullinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class ChatFullInfo(_ChatBase):
can_send_paid_media (:obj:`bool`, optional): :obj:`True`, if paid media messages can be
sent or forwarded to the channel chat. The field is available only for channel chats.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Attributes:
id (:obj:`int`): Unique identifier for this chat.
Expand Down Expand Up @@ -352,7 +352,7 @@ class ChatFullInfo(_ChatBase):
can_send_paid_media (:obj:`bool`): Optional. :obj:`True`, if paid media messages can be
sent or forwarded to the channel chat. The field is available only for channel chats.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
.. _accent colors: https://core.telegram.org/bots/api#accent-colors
.. _topics: https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups
Expand Down
6 changes: 3 additions & 3 deletions telegram/_files/inputmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class InputPaidMedia(TelegramObject):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
type (:obj:`str`): Type of media that the instance represents.
Expand Down Expand Up @@ -164,7 +164,7 @@ class InputPaidMediaPhoto(InputPaidMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
media (:obj:`str` | :term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | \
Expand Down Expand Up @@ -196,7 +196,7 @@ class InputPaidMediaVideo(InputPaidMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Note:
* When using a :class:`telegram.Video` for the :attr:`media` attribute, it will take the
Expand Down
2 changes: 1 addition & 1 deletion telegram/_menubutton.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def de_json(
bot (:class:`telegram.Bot`, optional): The bot associated with this object. Defaults to
:obj:`None`, in which case shortcut methods will not be available.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
:paramref:`bot` is now optional and defaults to :obj:`None`
Returns:
Expand Down
28 changes: 14 additions & 14 deletions telegram/_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,11 @@ class Message(MaybeInaccessibleMessage):
paid_media (:obj:`telegram.PaidMediaInfo`, optional): Message contains paid media;
information about the paid media.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
refunded_payment (:obj:`telegram.RefundedPayment`, optional): Message is a service message
about a refunded payment, information about the payment.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Attributes:
message_id (:obj:`int`): Unique message identifier inside this chat.
Expand Down Expand Up @@ -909,11 +909,11 @@ class Message(MaybeInaccessibleMessage):
paid_media (:obj:`telegram.PaidMediaInfo`): Optional. Message contains paid media;
information about the paid media.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
refunded_payment (:obj:`telegram.RefundedPayment`): Optional. Message is a service message
about a refunded payment, information about the payment.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
.. |custom_emoji_no_md1_support| replace:: Since custom emoji entities are not supported by
:attr:`~telegram.constants.ParseMode.MARKDOWN`, this method now raises a
Expand Down Expand Up @@ -1426,10 +1426,10 @@ def effective_attachment(
:attr:`dice`, :attr:`passport_data` and :attr:`poll` are now also considered to be an
attachment.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
:attr:`paid_media` is now also considered to be an attachment.
.. deprecated:: NEXT.VERSION
.. deprecated:: 21.4
:attr:`successful_payment` will be removed in future major versions.
"""
Expand All @@ -1442,7 +1442,7 @@ def effective_attachment(
if attachment_type == MessageAttachmentType.SUCCESSFUL_PAYMENT:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"21.4",
"successful_payment will no longer be considered an attachment in"
" future major versions",
),
Expand Down Expand Up @@ -3649,7 +3649,7 @@ async def edit_text(
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down Expand Up @@ -3706,7 +3706,7 @@ async def edit_caption(
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down Expand Up @@ -3759,7 +3759,7 @@ async def edit_media(
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down Expand Up @@ -3808,7 +3808,7 @@ async def edit_reply_markup(
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down Expand Up @@ -3862,7 +3862,7 @@ async def edit_live_location(
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down Expand Up @@ -3916,7 +3916,7 @@ async def stop_live_location(
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down Expand Up @@ -4072,7 +4072,7 @@ async def stop_poll(
For the documentation of the arguments, please see :meth:`telegram.Bot.stop_poll`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.4
Now also passes :attr:`business_connection_id`.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion telegram/_messageentity.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def adjust_message_entities_to_utf_16(
For more information, see `Unicode <https://en.wikipedia.org/wiki/Unicode>`_ and
`Plane (Unicode) <https://en.wikipedia.org/wiki/Plane_(Unicode)>`_.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Examples:
Below is a snippet of code that demonstrates how to use this function to convert
Expand Down
10 changes: 5 additions & 5 deletions telegram/_paidmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PaidMedia(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`type` is equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
type (:obj:`str`): Type of the paid media.
Expand Down Expand Up @@ -114,7 +114,7 @@ class PaidMediaPreview(PaidMedia):
considered equal, if their :attr:`width`, :attr:`height`, and :attr:`duration`
are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PREVIEW`.
Expand Down Expand Up @@ -156,7 +156,7 @@ class PaidMediaPhoto(PaidMedia):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`photo` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PHOTO`.
Expand Down Expand Up @@ -202,7 +202,7 @@ class PaidMediaVideo(PaidMedia):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`video` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
Expand Down Expand Up @@ -248,7 +248,7 @@ class PaidMediaInfo(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`star_count` and :attr:`paid_media` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 21.4
Args:
star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to
Expand Down
Loading

0 comments on commit 2ac4e00

Please sign in to comment.