Skip to content

Commit

Permalink
Bump Version to v20.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibo-Joshi committed Nov 27, 2023
1 parent da11561 commit a8f1164
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 32 deletions.
49 changes: 49 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,55 @@
Changelog
=========

Version 20.6
============

*Released 2023-11-27*

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

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

- Add ``JobQueue.scheduler_configuration`` and Corresponding Warnings (:pr:`3913` closes :issue:`3837`)
- Add Parameter ``socket_options`` to ``HTTPXRequest`` (:pr:`3935` closes :issue:`2965`)
- Add ``ApplicationBuilder.(get_updates_)socket_options`` (:pr:`3943`)
- Improve ``write_timeout`` Handling for Media Methods (:pr:`3952`)
- Add ``filters.Mention`` (:pr:`3941` closes :issue:`3799`)
- Rename ``proxy_url`` to ``proxy`` and Allow ``httpx.{Proxy, URL}`` as Input (:pr:`3939` closes :issue:`3844`)

Bug Fixes & Changes
-------------------

- Adjust ``read_timeout`` Behavior for ``Bot.get_updates`` (:pr:`3963` closes :issue:`3893`)
- Improve ``BaseHandler.__repr__`` for Callbacks without ``__qualname__`` (:pr:`3934`)
- Fix Persistency Issue with Ended Non-Blocking Conversations (:pr:`3962`)
- Improve Type Hinting for Arguments with Default Values in ``Bot`` (:pr:`3942`)

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

- Add Documentation for ``__aenter__`` and ``__aexit__`` Methods (:pr:`3907` closes :issue:`3886`)
- Improve Insertion of Kwargs into ``Bot`` Methods (:pr:`3965`)

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

- Adjust Tests to New Error Messages (:pr:`3970`)

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

- Bump ``pytest-xdist`` from 3.3.1 to 3.4.0 (:pr:`3975`)
- ``pre-commit`` autoupdate (:pr:`3967`)
- Update ``httpx`` requirement from ~=0.25.1 to ~=0.25.2 (:pr:`3983`)
- Bump ``pytest-xdist`` from 3.4.0 to 3.5.0 (:pr:`3982`)
- Update ``httpx`` requirement from ~=0.25.0 to ~=0.25.1 (:pr:`3961`)
- Bump ``srvaroa/labeler`` from 1.6.1 to 1.7.0 (:pr:`3958`)
- Update ``cachetools`` requirement from ~=5.3.1 to ~=5.3.2 (:pr:`3954`)
- Bump ``pytest`` from 7.4.2 to 7.4.3 (:pr:`3953`)


Version 20.6
============

Expand Down
4 changes: 2 additions & 2 deletions docs/auxil/kwargs_insertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
" seconds are used as write timeout."
"",
"",
" .. deprecated:: NEXT.VERSION",
" .. deprecated:: 20.7",
" In future versions, the default value will be changed to "
" :attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.",
"",
Expand All @@ -77,7 +77,7 @@
" :paramref:`timeout` will be added to this value.",
"",
"",
" .. versionchanged:: NEXT.VERSION",
" .. versionchanged:: 20.7",
" Defaults to :attr:`~telegram.request.BaseRequest.DEFAULT_NONE` instead of ",
" ``2``.",
]
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
# built documents.
#
# The short X.Y version.
version = "20.6" # telegram.__version__[:3]
version = "20.7" # telegram.__version__[:3]
# The full version, including alpha/beta/rc tags.
release = "20.6" # telegram.__version__
release = "20.7" # telegram.__version__

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = "6.1.3"
Expand Down
2 changes: 1 addition & 1 deletion telegram/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __str__(self) -> str:


__version_info__: Final[Version] = Version(
major=20, minor=6, micro=0, releaselevel="final", serial=0
major=20, minor=7, micro=0, releaselevel="final", serial=0
)
__version__: Final[str] = str(__version_info__)

Expand Down
10 changes: 5 additions & 5 deletions telegram/ext/_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,32 +748,32 @@ def run_polling(
:paramref:`telegram.Bot.get_updates.read_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.7
Defaults to :attr:`~telegram.request.BaseRequest.DEFAULT_NONE` instead of
``2``.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_read_timeout`.
write_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
:paramref:`telegram.Bot.get_updates.write_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_write_timeout`.
connect_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
:paramref:`telegram.Bot.get_updates.connect_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_connect_timeout`.
pool_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
:paramref:`telegram.Bot.get_updates.pool_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_pool_timeout`.
drop_pending_updates (:obj:`bool`, optional): Whether to clean any pending updates on
Expand Down
16 changes: 8 additions & 8 deletions telegram/ext/_applicationbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def proxy_url(self: BuilderType, proxy_url: str) -> BuilderType:
.. seealso:: :meth:`get_updates_proxy`
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Args:
proxy_url (:obj:`str` | ``httpx.Proxy`` | ``httpx.URL``): See
Expand All @@ -518,7 +518,7 @@ def proxy_url(self: BuilderType, proxy_url: str) -> BuilderType:
"""
warn(
"`ApplicationBuilder.proxy_url` is deprecated since version "
"NEXT.VERSION. Use `ApplicationBuilder.proxy` instead.",
"20.7. Use `ApplicationBuilder.proxy` instead.",
PTBDeprecationWarning,
stacklevel=2,
)
Expand All @@ -530,7 +530,7 @@ def proxy(self: BuilderType, proxy: Union[str, httpx.Proxy, httpx.URL]) -> Build
.. seealso:: :meth:`get_updates_proxy`
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Args:
proxy (:obj:`str` | ``httpx.Proxy`` | ``httpx.URL``): The URL to a proxy
Expand All @@ -550,7 +550,7 @@ def socket_options(self: BuilderType, socket_options: Collection[SocketOpt]) ->
.. seealso:: :meth:`get_updates_socket_options`
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Args:
socket_options (Collection[:obj:`tuple`], optional): Socket options. See
Expand Down Expand Up @@ -719,7 +719,7 @@ def get_updates_proxy_url(self: BuilderType, get_updates_proxy_url: str) -> Buil
.. seealso:: :meth:`proxy`
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Args:
get_updates_proxy_url (:obj:`str` | ``httpx.Proxy`` | ``httpx.URL``): See
Expand All @@ -730,7 +730,7 @@ def get_updates_proxy_url(self: BuilderType, get_updates_proxy_url: str) -> Buil
"""
warn(
"`ApplicationBuilder.get_updates_proxy_url` is deprecated since version "
"NEXT.VERSION. Use `ApplicationBuilder.get_updates_proxy` instead.",
"20.7. Use `ApplicationBuilder.get_updates_proxy` instead.",
PTBDeprecationWarning,
stacklevel=2,
)
Expand All @@ -744,7 +744,7 @@ def get_updates_proxy(
.. seealso:: :meth:`proxy`
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Args:
proxy (:obj:`str` | ``httpx.Proxy`` | ``httpx.URL``): The URL to a proxy server,
Expand All @@ -766,7 +766,7 @@ def get_updates_socket_options(
.. seealso:: :meth:`socket_options`
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Args:
get_updates_socket_options (Collection[:obj:`tuple`], optional): Socket options. See
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_jobqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def scheduler_configuration(self) -> JSONDict:
:meth:`~apscheduler.schedulers.base.BaseScheduler.add_jobstore` to avoid using
:meth:`~apscheduler.schedulers.base.BaseScheduler.configure` altogether.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Returns:
Dict[:obj:`str`, :obj:`object`]: The configuration values as dictionary.
Expand Down
10 changes: 5 additions & 5 deletions telegram/ext/_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,34 +239,34 @@ async def start_polling(
:paramref:`telegram.Bot.get_updates.read_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.7
Defaults to :attr:`~telegram.request.BaseRequest.DEFAULT_NONE` instead of
``2``.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_read_timeout` or
:paramref:`telegram.Bot.get_updates_request`.
write_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
:paramref:`telegram.Bot.get_updates.write_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_write_timeout` or
:paramref:`telegram.Bot.get_updates_request`.
connect_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
:paramref:`telegram.Bot.get_updates.connect_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_connect_timeout` or
:paramref:`telegram.Bot.get_updates_request`.
pool_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
:paramref:`telegram.Bot.get_updates.pool_timeout`. Defaults to
:attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
Deprecated in favor of setting the timeout via
:meth:`telegram.ext.ApplicationBuilder.get_updates_pool_timeout` or
:paramref:`telegram.Bot.get_updates_request`.
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ class Mention(MessageFilter):
MessageHandler(filters.Mention("username"), callback)
MessageHandler(filters.Mention(["@username", 123456]), callback)
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Args:
mentions (:obj:`int` | :obj:`str` | :class:`telegram.User` | Collection[:obj:`int` | \
Expand Down
4 changes: 2 additions & 2 deletions telegram/request/_baserequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def read_timeout(self) -> Optional[float]:
More precisely, the returned value should be the one used when
:paramref:`post.read_timeout` of :meth:post` is not passed/equal to :attr:`DEFAULT_NONE`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
Warning:
For now this property does not need to be implemented by subclasses and will raise
Expand Down Expand Up @@ -308,7 +308,7 @@ async def _request_wrapper(

# 20 is the documented default value for all the media related bot methods and custom
# implementations of BaseRequest may explicitly rely on that. Hence, we follow the
# standard deprecation policy and deprecate starting with version NEXT.VERSION.
# standard deprecation policy and deprecate starting with version 20.7.
# For our own implementation HTTPXRequest, we can handle that ourselves, so we skip the
# warning in that case.
has_files = request_data and request_data.multipart_data
Expand Down
10 changes: 5 additions & 5 deletions telegram/request/_httpxrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class HTTPXRequest(BaseRequest):
proxy_url (:obj:`str`, optional): Legacy name for :paramref:`proxy`, kept for backward
compatibility. Defaults to :obj:`None`.
.. deprecated:: NEXT.VERSION
.. deprecated:: 20.7
read_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
amount of time (in seconds) to wait for a response from Telegram's server.
This value is used unless a different value is passed to :meth:`do_request`.
Expand Down Expand Up @@ -95,7 +95,7 @@ class HTTPXRequest(BaseRequest):
This is a low-level parameter and should only be used if you are familiar with
these concepts.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
proxy (:obj:`str` | ``httpx.Proxy`` | ``httpx.URL``, optional): The URL to a proxy server,
a ``httpx.Proxy`` object or a ``httpx.URL`` object. For example
``'http://127.0.0.1:3128'`` or ``'socks5://127.0.0.1:3128'``. Defaults to :obj:`None`.
Expand All @@ -111,7 +111,7 @@ class HTTPXRequest(BaseRequest):
.. _the docs of httpx: https://www.python-httpx.org/environment_variables/#proxies
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.7
"""

Expand All @@ -135,7 +135,7 @@ def __init__(
if proxy_url is not None:
proxy = proxy_url
warn(
"The parameter `proxy_url` is deprecated since version NEXT.VERSION. Use `proxy` "
"The parameter `proxy_url` is deprecated since version 20.7. Use `proxy` "
"instead.",
PTBDeprecationWarning,
stacklevel=2,
Expand Down Expand Up @@ -252,7 +252,7 @@ async def do_request(

if isinstance(write_timeout, DefaultValue):
# Making the networking backend decide on the proper timeout values instead of doing
# it via the default values of the Bot methods was introduced in version NEXT.VERSION.
# it via the default values of the Bot methods was introduced in version 20.7.
# We hard-code the value here for now until we add additional parameters to this
# class to control the media_write_timeout separately.
write_timeout = self._client.timeout.write if not files else 20
Expand Down

0 comments on commit a8f1164

Please sign in to comment.