Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-zeroconf for openSUSE:Factory 
checked in at 2022-09-18 17:32:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zeroconf (Old)
 and      /work/SRC/openSUSE:Factory/.python-zeroconf.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-zeroconf"

Sun Sep 18 17:32:19 2022 rev:33 rq:1004384 version:0.39.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-zeroconf/python-zeroconf.changes  
2022-06-26 11:59:16.684354804 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-zeroconf.new.2083/python-zeroconf.changes    
    2022-09-18 17:32:20.849792779 +0200
@@ -1,0 +2,24 @@
+Sat Sep 17 18:38:52 UTC 2022 - Antoine Belvire <[email protected]>
+
+- Re-enable test_service_browser_expire_callbacks: Should be fixed
+  with 0.39.0 (gh#jstasiak/python-zeroconf!1084).
+- Add missing dependency on python-async_timeout at run time.
+
+-------------------------------------------------------------------
+Sat Sep 17 16:40:31 UTC 2022 - marec <[email protected]>
+
+- Added build dependency python-async_timeout in order to fix build
+  failure.
+
+-------------------------------------------------------------------
+Sat Sep 17 07:29:19 UTC 2022 - Dirk M??ller <[email protected]>
+
+- Update to 0.39.1:
+  * Performance improvements for constructing outgoing packet data. 
+- Changes from 0.39.0:
+  * Switch to using async_timeout for timeouts: Significantly
+    reduces the number of asyncio tasks that are created when using
+    ServiceInfo or AsyncServiceInfo
+    (gh#jstasiak/python-zeroconf!1081).
+
+-------------------------------------------------------------------

Old:
----
  python-zeroconf-0.38.7.obscpio

New:
----
  python-zeroconf-0.39.1.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-zeroconf.spec ++++++
--- /var/tmp/diff_new_pack.LGKgz0/_old  2022-09-18 17:32:21.585794926 +0200
+++ /var/tmp/diff_new_pack.LGKgz0/_new  2022-09-18 17:32:21.593794949 +0200
@@ -20,19 +20,21 @@
 %define skip_python2 1
 %define skip_python36 1
 Name:           python-zeroconf
-Version:        0.38.7
+Version:        0.39.1
 Release:        0
 Summary:        Pure Python Multicast DNS Service Discovery Library 
(Bonjour/Avahi compatible)
 License:        LGPL-2.0-only
 Group:          Development/Languages/Python
 URL:            https://github.com/jstasiak/python-zeroconf
 Source:         %{name}-%{version}.tar.xz
+BuildRequires:  %{python_module async_timeout >= 4.0.1}
 BuildRequires:  %{python_module ifaddr >= 0.1.7}
 BuildRequires:  %{python_module pytest-asyncio}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+Requires:       python-async_timeout >= 4.0.1
 Requires:       python-ifaddr >= 0.1.7
 BuildArch:      noarch
 %python_subpackages
@@ -60,8 +62,7 @@
 # - test_integration_with_listener_ipv6: Requires network access
 # - test_launch*: Require network access
 # - test_close_multiple_times: Requires network access
-# - test_service_browser_expire_callbacks: Flakey 
(gh#jstasiak/python-zeroconf#1077)
-%pytest tests -k 'not (test_integration_with_listener_ipv6 or test_launch or 
test_close_multiple_times or test_service_browser_expire_callbacks)'
+%pytest tests -k 'not (test_integration_with_listener_ipv6 or test_launch or 
test_close_multiple_times)'
 
 %files %{python_files}
 %doc README.rst

++++++ _service ++++++
--- /var/tmp/diff_new_pack.LGKgz0/_old  2022-09-18 17:32:21.633795066 +0200
+++ /var/tmp/diff_new_pack.LGKgz0/_new  2022-09-18 17:32:21.637795077 +0200
@@ -2,7 +2,7 @@
   <service name="obs_scm" mode="disabled">
     <param name="url">https://github.com/jstasiak/python-zeroconf</param>
     <param name="scm">git</param>
-    <param name="revision">0.38.7</param>
+    <param name="revision">0.39.1</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="versionrewrite-pattern">(.*)</param>
   </service>

++++++ python-zeroconf-0.38.7.obscpio -> python-zeroconf-0.39.1.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/.gitignore 
new/python-zeroconf-0.39.1/.gitignore
--- old/python-zeroconf-0.38.7/.gitignore       1970-01-01 01:00:00.000000000 
+0100
+++ new/python-zeroconf-0.39.1/.gitignore       2022-09-05 21:44:45.000000000 
+0200
@@ -0,0 +1,16 @@
+build/
+*.pyc
+*.pyo
+Thumbs.db
+.DS_Store
+.project
+.pydevproject
+.settings
+.idea
+.vslick
+.cache
+.mypy_cache/
+docs/_build/
+.vscode
+/dist/
+/zeroconf.egg-info/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/Makefile 
new/python-zeroconf-0.39.1/Makefile
--- old/python-zeroconf-0.38.7/Makefile 2022-06-14 19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/Makefile 2022-09-05 21:44:45.000000000 +0200
@@ -1,4 +1,4 @@
-# version: 1.2
+# version: 1.3
 
 .PHONY: all virtualenv
 MAX_LINE_LENGTH=110
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/README.rst 
new/python-zeroconf-0.39.1/README.rst
--- old/python-zeroconf-0.38.7/README.rst       2022-06-14 19:49:19.000000000 
+0200
+++ new/python-zeroconf-0.39.1/README.rst       2022-09-05 21:44:45.000000000 
+0200
@@ -141,6 +141,22 @@
 Changelog
 =========
 
+0.39.1
+======
+
+* Performance improvements for constructing outgoing packet data (#1090) 
@bdraco
+
+
+0.39.0
+======
+
+Technically backwards incompatible:
+
+* Switch to using async_timeout for timeouts (#1081) @bdraco
+
+  Significantly reduces the number of asyncio tasks that are created when
+  using `ServiceInfo` or `AsyncServiceInfo`
+
 
 0.38.7
 ======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/requirements-dev.txt 
new/python-zeroconf-0.39.1/requirements-dev.txt
--- old/python-zeroconf-0.38.7/requirements-dev.txt     2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/requirements-dev.txt     2022-09-05 
21:44:45.000000000 +0200
@@ -1,7 +1,7 @@
+async_timeout>=4.0.1
 autopep8
 black;implementation_name=="cpython"
 bump2version
-coveralls
 coverage
 flake8
 flake8-import-order
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/setup.cfg 
new/python-zeroconf-0.39.1/setup.cfg
--- old/python-zeroconf-0.38.7/setup.cfg        2022-06-14 19:49:19.000000000 
+0200
+++ new/python-zeroconf-0.39.1/setup.cfg        2022-09-05 21:44:45.000000000 
+0200
@@ -1,35 +1,35 @@
-[bumpversion]
-current_version = 0.38.7
-commit = True
-tag = True
-tag_name = {new_version}
-
-[bumpversion:file:zeroconf/__init__.py]
-search = __version__ = '{current_version}'
-replace = __version__ = '{new_version}'
-
-[tool:pytest]
-testpaths = tests
-
-[flake8]
-show-source = 1
-application-import-names = zeroconf
-max-line-length = 110
-ignore = E203,W503,N818
-
-[mypy]
-ignore_missing_imports = true
-follow_imports = skip
-check_untyped_defs = true
-no_implicit_optional = true
-warn_incomplete_stub = true
-warn_no_return = true
-warn_redundant_casts = true
-warn_unused_configs = true
-warn_unused_ignores = true
-warn_return_any = true
-disallow_untyped_calls = false
-disallow_untyped_defs = true
-
-[mypy-zeroconf.test]
-disallow_untyped_defs = false
+[bumpversion]
+current_version = 0.39.1
+commit = True
+tag = True
+tag_name = {new_version}
+
+[bumpversion:file:zeroconf/__init__.py]
+search = __version__ = '{current_version}'
+replace = __version__ = '{new_version}'
+
+[tool:pytest]
+testpaths = tests
+
+[flake8]
+show-source = 1
+application-import-names = zeroconf
+max-line-length = 110
+ignore = E203,W503,N818
+
+[mypy]
+ignore_missing_imports = true
+follow_imports = skip
+check_untyped_defs = true
+no_implicit_optional = true
+warn_incomplete_stub = true
+warn_no_return = true
+warn_redundant_casts = true
+warn_unused_configs = true
+warn_unused_ignores = true
+warn_return_any = true
+disallow_untyped_calls = false
+disallow_untyped_defs = true
+
+[mypy-zeroconf.test]
+disallow_untyped_defs = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/setup.py 
new/python-zeroconf-0.39.1/setup.py
--- old/python-zeroconf-0.38.7/setup.py 2022-06-14 19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/setup.py 2022-09-05 21:44:45.000000000 +0200
@@ -45,5 +45,5 @@
         'Programming Language :: Python :: Implementation :: PyPy',
     ],
     keywords=['Bonjour', 'Avahi', 'Zeroconf', 'Multicast DNS', 'Service 
Discovery', 'mDNS'],
-    install_requires=['ifaddr>=0.1.7'],
+    install_requires=['async_timeout>=4.0.1', 'ifaddr>=0.1.7'],
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-zeroconf-0.38.7/tests/services/test_browser.py 
new/python-zeroconf-0.39.1/tests/services/test_browser.py
--- old/python-zeroconf-0.38.7/tests/services/test_browser.py   2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/tests/services/test_browser.py   2022-09-05 
21:44:45.000000000 +0200
@@ -1165,11 +1165,21 @@
         mock_incoming_msg([info.dns_service()]),
     )
 
+    for _ in range(10):
+        time.sleep(0.05)
+        if len(callbacks) == 2:
+            break
+
     assert callbacks == [
         ('add', type_, registration_name),
         ('update', type_, registration_name),
     ]
-    time.sleep(1.1)
+
+    for _ in range(25):
+        time.sleep(0.05)
+        if len(callbacks) == 3:
+            break
+
     assert callbacks == [
         ('add', type_, registration_name),
         ('update', type_, registration_name),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/tests/test_core.py 
new/python-zeroconf-0.39.1/tests/test_core.py
--- old/python-zeroconf-0.38.7/tests/test_core.py       2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/tests/test_core.py       2022-09-05 
21:44:45.000000000 +0200
@@ -460,7 +460,13 @@
     assert zc.cache.get(entry) is None
 
     zc.send(generated)
-    time.sleep(0.2)
+
+    # Handle slow github CI runners on windows
+    for _ in range(10):
+        time.sleep(0.05)
+        if zc.cache.get(entry) is not None:
+            break
+
     assert zc.cache.get(entry) is not None
 
     zc.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/tests/utils/test_asyncio.py 
new/python-zeroconf-0.39.1/tests/utils/test_asyncio.py
--- old/python-zeroconf-0.38.7/tests/utils/test_asyncio.py      2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/tests/utils/test_asyncio.py      2022-09-05 
21:44:45.000000000 +0200
@@ -114,12 +114,45 @@
     ) < 1 + _CLOSE_TIMEOUT + _LOADED_SYSTEM_TIMEOUT
 
 
[email protected]
 async def test_run_coro_with_timeout() -> None:
     """Test running a coroutine with a timeout raises EventLoopBlocked."""
     loop = asyncio.get_event_loop()
+    task = None
+
+    async def _saved_sleep_task():
+        nonlocal task
+        task = asyncio.create_task(asyncio.sleep(0.2))
+        await task
 
     def _run_in_loop():
-        aioutils.run_coro_with_timeout(asyncio.sleep(0.3), loop, 0.1)
+        aioutils.run_coro_with_timeout(_saved_sleep_task(), loop, 0.1)
 
     with pytest.raises(EventLoopBlocked), patch.object(aioutils, 
"_LOADED_SYSTEM_TIMEOUT", 0.0):
         await loop.run_in_executor(None, _run_in_loop)
+
+    # ensure the thread is shutdown
+    task.cancel()
+    await asyncio.sleep(0)
+    await _shutdown_default_executor(loop)
+
+
+# Remove this when we drop support for older python versions
+# since we can use loop.shutdown_default_executor() in 3.9+
+async def _shutdown_default_executor(loop: asyncio.AbstractEventLoop) -> None:
+    """Backport of cpython 3.9 schedule the shutdown of the default 
executor."""
+    future = loop.create_future()
+
+    def _do_shutdown() -> None:
+        try:
+            loop._default_executor.shutdown(wait=True)  # type: ignore  # 
pylint: disable=protected-access
+            loop.call_soon_threadsafe(future.set_result, None)
+        except Exception as ex:  # pylint: disable=broad-except
+            loop.call_soon_threadsafe(future.set_exception, ex)
+
+    thread = threading.Thread(target=_do_shutdown)
+    thread.start()
+    try:
+        await future
+    finally:
+        thread.join()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/zeroconf/__init__.py 
new/python-zeroconf-0.39.1/zeroconf/__init__.py
--- old/python-zeroconf-0.38.7/zeroconf/__init__.py     2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/zeroconf/__init__.py     2022-09-05 
21:44:45.000000000 +0200
@@ -1,119 +1,119 @@
-""" Multicast DNS Service Discovery for Python, v0.14-wmcbrine
-    Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
-
-    This module provides a framework for the use of DNS Service Discovery
-    using IP multicast.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-    USA
-"""
-
-import sys
-
-from ._cache import DNSCache  # noqa # import needed for backwards compat
-from ._core import Zeroconf
-from ._dns import (  # noqa # import needed for backwards compat
-    DNSAddress,
-    DNSEntry,
-    DNSHinfo,
-    DNSNsec,
-    DNSPointer,
-    DNSQuestion,
-    DNSRecord,
-    DNSService,
-    DNSText,
-    DNSQuestionType,
-)
-from ._exceptions import (
-    AbstractMethodException,
-    BadTypeInNameException,
-    Error,
-    EventLoopBlocked,
-    IncomingDecodeError,
-    NamePartTooLongException,
-    NonUniqueNameException,
-    NotRunningException,
-    ServiceNameAlreadyRegistered,
-)
-from ._logger import QuietLogger, log  # noqa # import needed for backwards 
compat
-from ._protocol.incoming import DNSIncoming  # noqa # import needed for 
backwards compat
-from ._protocol.outgoing import DNSOutgoing  # noqa # import needed for 
backwards compat
-from ._services import (  # noqa # import needed for backwards compat
-    Signal,
-    SignalRegistrationInterface,
-    ServiceListener,
-    ServiceStateChange,
-)
-from ._services.browser import ServiceBrowser
-from ._services.info import (  # noqa # import needed for backwards compat
-    instance_name_from_service_info,
-    ServiceInfo,
-)
-from ._services.registry import ServiceRegistry  # noqa # import needed for 
backwards compat
-from ._services.types import ZeroconfServiceTypes
-from ._updates import RecordUpdate, RecordUpdateListener
-from ._utils.name import service_type_name  # noqa # import needed for 
backwards compat
-from ._utils.net import (  # noqa # import needed for backwards compat
-    add_multicast_member,
-    autodetect_ip_version,
-    create_sockets,
-    get_all_addresses_v6,
-    InterfaceChoice,
-    InterfacesType,
-    IPVersion,
-    get_all_addresses,
-)
-from ._utils.time import current_time_millis, millis_to_seconds  # noqa # 
import needed for backwards compat
-
-__author__ = 'Paul Scott-Murphy, William McBrine'
-__maintainer__ = 'Jakub Stasiak <[email protected]>'
-__version__ = '0.38.7'
-__license__ = 'LGPL'
-
-
-__all__ = [
-    "__version__",
-    "Zeroconf",
-    "ServiceInfo",
-    "ServiceBrowser",
-    "ServiceListener",
-    "DNSQuestionType",
-    "InterfaceChoice",
-    "ServiceStateChange",
-    "IPVersion",
-    "ZeroconfServiceTypes",
-    "RecordUpdate",
-    "RecordUpdateListener",
-    "current_time_millis",
-    # Exceptions
-    "Error",
-    "AbstractMethodException",
-    "BadTypeInNameException",
-    "EventLoopBlocked",
-    "IncomingDecodeError",
-    "NamePartTooLongException",
-    "NonUniqueNameException",
-    "NotRunningException",
-    "ServiceNameAlreadyRegistered",
-]
-
-if sys.version_info <= (3, 6):  # pragma: no cover
-    raise ImportError(  # pragma: no cover
-        '''
-Python version > 3.6 required for python-zeroconf.
-If you need support for Python 2 or Python 3.3-3.4 please use version 19.1
-If you need support for Python 3.5 please use version 0.28.0
-    '''
-    )
+""" Multicast DNS Service Discovery for Python, v0.14-wmcbrine
+    Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
+
+    This module provides a framework for the use of DNS Service Discovery
+    using IP multicast.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+    USA
+"""
+
+import sys
+
+from ._cache import DNSCache  # noqa # import needed for backwards compat
+from ._core import Zeroconf
+from ._dns import (  # noqa # import needed for backwards compat
+    DNSAddress,
+    DNSEntry,
+    DNSHinfo,
+    DNSNsec,
+    DNSPointer,
+    DNSQuestion,
+    DNSRecord,
+    DNSService,
+    DNSText,
+    DNSQuestionType,
+)
+from ._exceptions import (
+    AbstractMethodException,
+    BadTypeInNameException,
+    Error,
+    EventLoopBlocked,
+    IncomingDecodeError,
+    NamePartTooLongException,
+    NonUniqueNameException,
+    NotRunningException,
+    ServiceNameAlreadyRegistered,
+)
+from ._logger import QuietLogger, log  # noqa # import needed for backwards 
compat
+from ._protocol.incoming import DNSIncoming  # noqa # import needed for 
backwards compat
+from ._protocol.outgoing import DNSOutgoing  # noqa # import needed for 
backwards compat
+from ._services import (  # noqa # import needed for backwards compat
+    Signal,
+    SignalRegistrationInterface,
+    ServiceListener,
+    ServiceStateChange,
+)
+from ._services.browser import ServiceBrowser
+from ._services.info import (  # noqa # import needed for backwards compat
+    instance_name_from_service_info,
+    ServiceInfo,
+)
+from ._services.registry import ServiceRegistry  # noqa # import needed for 
backwards compat
+from ._services.types import ZeroconfServiceTypes
+from ._updates import RecordUpdate, RecordUpdateListener
+from ._utils.name import service_type_name  # noqa # import needed for 
backwards compat
+from ._utils.net import (  # noqa # import needed for backwards compat
+    add_multicast_member,
+    autodetect_ip_version,
+    create_sockets,
+    get_all_addresses_v6,
+    InterfaceChoice,
+    InterfacesType,
+    IPVersion,
+    get_all_addresses,
+)
+from ._utils.time import current_time_millis, millis_to_seconds  # noqa # 
import needed for backwards compat
+
+__author__ = 'Paul Scott-Murphy, William McBrine'
+__maintainer__ = 'Jakub Stasiak <[email protected]>'
+__version__ = '0.39.1'
+__license__ = 'LGPL'
+
+
+__all__ = [
+    "__version__",
+    "Zeroconf",
+    "ServiceInfo",
+    "ServiceBrowser",
+    "ServiceListener",
+    "DNSQuestionType",
+    "InterfaceChoice",
+    "ServiceStateChange",
+    "IPVersion",
+    "ZeroconfServiceTypes",
+    "RecordUpdate",
+    "RecordUpdateListener",
+    "current_time_millis",
+    # Exceptions
+    "Error",
+    "AbstractMethodException",
+    "BadTypeInNameException",
+    "EventLoopBlocked",
+    "IncomingDecodeError",
+    "NamePartTooLongException",
+    "NonUniqueNameException",
+    "NotRunningException",
+    "ServiceNameAlreadyRegistered",
+]
+
+if sys.version_info <= (3, 6):  # pragma: no cover
+    raise ImportError(  # pragma: no cover
+        '''
+Python version > 3.6 required for python-zeroconf.
+If you need support for Python 2 or Python 3.3-3.4 please use version 19.1
+If you need support for Python 3.5 please use version 0.28.0
+    '''
+    )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-zeroconf-0.38.7/zeroconf/_protocol/outgoing.py 
new/python-zeroconf-0.39.1/zeroconf/_protocol/outgoing.py
--- old/python-zeroconf-0.38.7/zeroconf/_protocol/outgoing.py   2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/zeroconf/_protocol/outgoing.py   2022-09-05 
21:44:45.000000000 +0200
@@ -21,8 +21,7 @@
 """
 
 import enum
-import struct
-from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
+from typing import Dict, List, Optional, Sequence, Tuple, Union
 
 from . import DNSMessage
 from .incoming import DNSIncoming
@@ -180,29 +179,28 @@
         for cached_entry in cached_entries:
             self.add_answer_at_time(cached_entry, now)
 
-    def _pack(self, format_: Union[bytes, str], size: int, value: Any) -> None:
-        self.data.append(struct.pack(format_, value))
-        self.size += size
-
     def _write_byte(self, value: int) -> None:
         """Writes a single byte to the packet"""
-        self._pack(b'!c', 1, bytes((value,)))
+        self.data.append(value.to_bytes(1, 'big'))
+        self.size += 1
 
     def _insert_short_at_start(self, value: int) -> None:
         """Inserts an unsigned short at the start of the packet"""
-        self.data.insert(0, struct.pack(b'!H', value))
+        self.data.insert(0, value.to_bytes(2, 'big'))
 
     def _replace_short(self, index: int, value: int) -> None:
         """Replaces an unsigned short in a certain position in the packet"""
-        self.data[index] = struct.pack(b'!H', value)
+        self.data[index] = value.to_bytes(2, 'big')
 
     def write_short(self, value: int) -> None:
         """Writes an unsigned short to the packet"""
-        self._pack(b'!H', 2, value)
+        self.data.append(value.to_bytes(2, 'big'))
+        self.size += 2
 
     def _write_int(self, value: Union[float, int]) -> None:
         """Writes an unsigned integer to the packet"""
-        self._pack(b'!I', 4, int(value))
+        self.data.append(int(value).to_bytes(4, 'big'))
+        self.size += 4
 
     def write_string(self, value: bytes) -> None:
         """Writes a string to the packet"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/zeroconf/_utils/asyncio.py 
new/python-zeroconf-0.39.1/zeroconf/_utils/asyncio.py
--- old/python-zeroconf-0.38.7/zeroconf/_utils/asyncio.py       2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/zeroconf/_utils/asyncio.py       2022-09-05 
21:44:45.000000000 +0200
@@ -25,6 +25,8 @@
 import contextlib
 from typing import Any, Awaitable, Coroutine, Optional, Set
 
+import async_timeout
+
 from .time import millis_to_seconds
 from .._exceptions import EventLoopBlocked
 from ..const import _LOADED_SYSTEM_TIMEOUT
@@ -35,28 +37,11 @@
 _WAIT_FOR_LOOP_TASKS_TIMEOUT = 3  # Must be larger than _TASK_AWAIT_TIMEOUT
 
 
-# Switch to asyncio.wait_for once https://bugs.python.org/issue39032 is fixed
 async def wait_event_or_timeout(event: asyncio.Event, timeout: float) -> None:
     """Wait for an event or timeout."""
-    loop = asyncio.get_event_loop()
-    future = loop.create_future()
-
-    def _handle_timeout_or_wait_complete(*_: Any) -> None:
-        if not future.done():
-            future.set_result(None)
-
-    timer_handle = loop.call_later(timeout, _handle_timeout_or_wait_complete)
-    event_wait = loop.create_task(event.wait())
-    event_wait.add_done_callback(_handle_timeout_or_wait_complete)
-
-    try:
-        await future
-    finally:
-        timer_handle.cancel()
-        if not event_wait.done():
-            event_wait.cancel()
-        with contextlib.suppress(asyncio.CancelledError):
-            await event_wait
+    with contextlib.suppress(asyncio.TimeoutError):
+        async with async_timeout.timeout(timeout):
+            await event.wait()
 
 
 async def _async_get_all_tasks(loop: asyncio.AbstractEventLoop) -> 
Set[asyncio.Task]:
@@ -114,7 +99,6 @@
     loop.call_soon_threadsafe(loop.stop)
 
 
-# Remove the call to _get_running_loop once we drop python 3.6 support
 def get_running_loop() -> Optional[asyncio.AbstractEventLoop]:
     """Check if an event loop is already running."""
     with contextlib.suppress(RuntimeError):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-zeroconf-0.38.7/zeroconf/asyncio.py 
new/python-zeroconf-0.39.1/zeroconf/asyncio.py
--- old/python-zeroconf-0.38.7/zeroconf/asyncio.py      2022-06-14 
19:49:19.000000000 +0200
+++ new/python-zeroconf-0.39.1/zeroconf/asyncio.py      2022-09-05 
21:44:45.000000000 +0200
@@ -132,8 +132,9 @@
 
     Supports registration, unregistration, queries and browsing.
 
-    The async version is currently a wrapper around the sync version
-    with I/O being done in the executor for backwards compatibility.
+    The async version is currently a wrapper around Zeroconf which
+    is now also async. It is expected that an asyncio event loop
+    is already running before creating the AsyncZeroconf object.
     """
 
     def __init__(
@@ -145,7 +146,7 @@
         zc: Optional[Zeroconf] = None,
     ) -> None:
         """Creates an instance of the Zeroconf class, establishing
-        multicast communications, listening and reaping threads.
+        multicast communications, and listening.
 
         :param interfaces: :class:`InterfaceChoice` or a list of IP addresses
             (IPv4 and IPv6) and interface indexes (IPv6 only).

++++++ python-zeroconf.obsinfo ++++++
--- /var/tmp/diff_new_pack.LGKgz0/_old  2022-09-18 17:32:21.817795603 +0200
+++ /var/tmp/diff_new_pack.LGKgz0/_new  2022-09-18 17:32:21.825795626 +0200
@@ -1,6 +1,5 @@
 name: python-zeroconf
-version: 0.38.7
-mtime: 1655228959
-commit: f3a9f804914fec37e961f80f347c4e706c4bae33
-
+version: 0.39.1
+mtime: 1662407085
+commit: 6f90896a590d6d60db75688a1ba753c333c8faab
 

Reply via email to