Package: src:switchbot-api
Version: 2.11.1-2
Severity: serious
Tags: ftbfs forky sid
User: [email protected]
Usertags: aiohttp-3.14

Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202606/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:switchbot-api, so that this is still
visible in the BTS web page for this package.

Thanks.

--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 debian/rules binary
dh binary --buildsystem=pybuild
   dh_update_autotools_config -O--buildsystem=pybuild
   dh_autoreconf -O--buildsystem=pybuild
   dh_auto_configure -O--buildsystem=pybuild
   dh_auto_build -O--buildsystem=pybuild
I: pybuild plugin_pyproject:142: Building wheel for python3.14 with "build" 
module
I: pybuild base:385: python3.14 -m build --skip-dependency-check --no-isolation 
--wheel --outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14  

[... snipped ...]

/usr/lib/python3/dist-packages/aioresponses/core.py:512: in _request_mock
    response = await self.match(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:456: in match
    response_or_exc = await matcher.build_response(
/usr/lib/python3/dist-packages/aioresponses/core.py:202: in build_response
    resp = self._build_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aioresponses.core.RequestMatch object at 0x7f9767a8b770>
url = URL('https://api.switch-bot.com/v1.1/devices/abc/status'), method = 'get'
request_headers = {'Authorization': 'token', 'Content-Type': 
'application/json', 'charset': 'utf8', 'nonce': 
'30705cb3-657c-454c-a9a1-a17c467311cd', ...}
status = 200
body = b'{\n  "statusCode": 100,\n  "body": {\n    "version": "V1.2",\n    
"calibrate": true,\n    "group": false,\n    "movi...: "FF711F51601E",\n    
"deviceType": "Curtain3",\n    "hubDeviceId": "D82812821F08"\n  },\n  
"message": "success"\n}\n'
content_type = 'application/json', payload = None, headers = None
response_class = <class 'aiohttp.client_reqrep.ClientResponse'>, reason = 'OK'

    def _build_response(self, url: 'Union[URL, str]',
                        method: str = hdrs.METH_GET,
                        request_headers: Optional[Dict] = None,
                        status: int = 200,
                        body: Union[str, bytes] = '',
                        content_type: str = 'application/json',
                        payload: Optional[Dict] = None,
                        headers: Optional[Dict] = None,
                        response_class: Optional[Type[ClientResponse]] = None,
                        reason: Optional[str] = None) -> ClientResponse:
        if response_class is None:
            response_class = ClientResponse
        if payload is not None:
            body = json.dumps(payload)
        if not isinstance(body, bytes):
            body = str.encode(body)
        if request_headers is None:
            request_headers = {}
        loop = Mock()
        loop.get_debug = Mock()
        loop.get_debug.return_value = True
        kwargs = {}  # type: Dict[str, Any]
        kwargs['request_info'] = RequestInfo(
            url=url,
            method=method,
            headers=CIMultiDictProxy(CIMultiDict(**request_headers)),
        )
        kwargs['writer'] = None
        kwargs['continue100'] = None
        kwargs['timer'] = TimerNoop()
        kwargs['traces'] = []
        kwargs['loop'] = loop
        kwargs['session'] = None
    
        # We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
>       resp = response_class(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: ClientResponse.__init__() missing 1 required keyword-only 
argument: 'stream_writer'

/usr/lib/python3/dist-packages/aioresponses/core.py:171: TypeError
__________________________ test_device_status[hub_2] ___________________________

client = <switchbot_api.SwitchBotAPI object at 0x7f9767a23020>
responses = <aioresponses.core.aioresponses object at 0x7f9767a22be0>
snapshot = SnapshotAssertion(name='snapshot', num_executions=0)
device_fixture = 'hub_2'

    @pytest.mark.parametrize(
        "device_fixture",
        [
            "curtain",
            "curtain3",
            "hub_2",
        ],
    )
    async def test_device_status(
        client: SwitchBotAPI,
        responses: aioresponses,
        snapshot: SnapshotAssertion,
        device_fixture: str,
    ) -> None:
        """Test fetching device status."""
        responses.get(
            f"{MOCK_URL}/devices/abc/status",
            status=200,
            body=load_fixture(f"{device_fixture}.json"),
        )
>       assert await client.get_status("abc") == snapshot
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_client.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
switchbot_api/__init__.py:263: in get_status
    response = await self._request(METH_GET, f"devices/{device_id}/status")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
switchbot_api/__init__.py:206: in _request
    response = await self.session.request(
<string>:3: in _request
    ???
/usr/lib/python3.13/unittest/mock.py:2332: in _execute_mock_call
    result = await effect(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:512: in _request_mock
    response = await self.match(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:456: in match
    response_or_exc = await matcher.build_response(
/usr/lib/python3/dist-packages/aioresponses/core.py:202: in build_response
    resp = self._build_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aioresponses.core.RequestMatch object at 0x7f9767a22690>
url = URL('https://api.switch-bot.com/v1.1/devices/abc/status'), method = 'get'
request_headers = {'Authorization': 'token', 'Content-Type': 
'application/json', 'charset': 'utf8', 'nonce': 
'045b2adb-c04b-4e79-ac4f-a9989b7a6bbc', ...}
status = 200
body = b'{\n  "statusCode": 100,\n  "body": {\n    "version": "V2.3-1.4",\n    
"temperature": 17.8,\n    "lightLevel": 1,\n  ...Id": "D82812821F08",\n    
"deviceType": "Hub 2",\n    "hubDeviceId": "D82812821F08"\n  },\n  "message": 
"success"\n}\n'
content_type = 'application/json', payload = None, headers = None
response_class = <class 'aiohttp.client_reqrep.ClientResponse'>, reason = 'OK'

    def _build_response(self, url: 'Union[URL, str]',
                        method: str = hdrs.METH_GET,
                        request_headers: Optional[Dict] = None,
                        status: int = 200,
                        body: Union[str, bytes] = '',
                        content_type: str = 'application/json',
                        payload: Optional[Dict] = None,
                        headers: Optional[Dict] = None,
                        response_class: Optional[Type[ClientResponse]] = None,
                        reason: Optional[str] = None) -> ClientResponse:
        if response_class is None:
            response_class = ClientResponse
        if payload is not None:
            body = json.dumps(payload)
        if not isinstance(body, bytes):
            body = str.encode(body)
        if request_headers is None:
            request_headers = {}
        loop = Mock()
        loop.get_debug = Mock()
        loop.get_debug.return_value = True
        kwargs = {}  # type: Dict[str, Any]
        kwargs['request_info'] = RequestInfo(
            url=url,
            method=method,
            headers=CIMultiDictProxy(CIMultiDict(**request_headers)),
        )
        kwargs['writer'] = None
        kwargs['continue100'] = None
        kwargs['timer'] = TimerNoop()
        kwargs['traces'] = []
        kwargs['loop'] = loop
        kwargs['session'] = None
    
        # We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
>       resp = response_class(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: ClientResponse.__init__() missing 1 required keyword-only 
argument: 'stream_writer'

/usr/lib/python3/dist-packages/aioresponses/core.py:171: TypeError
_________________________ test_device_status_ir_remote _________________________

client = <switchbot_api.SwitchBotAPI object at 0x7f97679e09e0>
responses = <aioresponses.core.aioresponses object at 0x7f97679e0af0>

    async def test_device_status_ir_remote(
        client: SwitchBotAPI,
        responses: aioresponses,
    ) -> None:
        """Test that fetching status for an IR remote does not raise.
    
        The SwitchBot Cloud API returns an empty body for IR remote devices
        (the docstring on ``get_status`` already notes "No status for IR
        devices"), so the unwrapped response has no ``deviceType`` key.
        Regression test: previously this raised ``KeyError: 'deviceType'``.
        """
        responses.get(
            f"{MOCK_URL}/devices/abc/status",
            status=200,
            body=load_fixture("ir_remote.json"),
        )
>       assert await client.get_status("abc") == {}
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_client.py:125: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
switchbot_api/__init__.py:263: in get_status
    response = await self._request(METH_GET, f"devices/{device_id}/status")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
switchbot_api/__init__.py:206: in _request
    response = await self.session.request(
<string>:3: in _request
    ???
/usr/lib/python3.13/unittest/mock.py:2332: in _execute_mock_call
    result = await effect(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:512: in _request_mock
    response = await self.match(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:456: in match
    response_or_exc = await matcher.build_response(
/usr/lib/python3/dist-packages/aioresponses/core.py:202: in build_response
    resp = self._build_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aioresponses.core.RequestMatch object at 0x7f97679e1040>
url = URL('https://api.switch-bot.com/v1.1/devices/abc/status'), method = 'get'
request_headers = {'Authorization': 'token', 'Content-Type': 
'application/json', 'charset': 'utf8', 'nonce': 
'914497f7-375b-4ca6-ba5d-477afdfc6713', ...}
status = 200
body = b'{\n  "statusCode": 100,\n  "body": {},\n  "message": "success"\n}\n'
content_type = 'application/json', payload = None, headers = None
response_class = <class 'aiohttp.client_reqrep.ClientResponse'>, reason = 'OK'

    def _build_response(self, url: 'Union[URL, str]',
                        method: str = hdrs.METH_GET,
                        request_headers: Optional[Dict] = None,
                        status: int = 200,
                        body: Union[str, bytes] = '',
                        content_type: str = 'application/json',
                        payload: Optional[Dict] = None,
                        headers: Optional[Dict] = None,
                        response_class: Optional[Type[ClientResponse]] = None,
                        reason: Optional[str] = None) -> ClientResponse:
        if response_class is None:
            response_class = ClientResponse
        if payload is not None:
            body = json.dumps(payload)
        if not isinstance(body, bytes):
            body = str.encode(body)
        if request_headers is None:
            request_headers = {}
        loop = Mock()
        loop.get_debug = Mock()
        loop.get_debug.return_value = True
        kwargs = {}  # type: Dict[str, Any]
        kwargs['request_info'] = RequestInfo(
            url=url,
            method=method,
            headers=CIMultiDictProxy(CIMultiDict(**request_headers)),
        )
        kwargs['writer'] = None
        kwargs['continue100'] = None
        kwargs['timer'] = TimerNoop()
        kwargs['traces'] = []
        kwargs['loop'] = loop
        kwargs['session'] = None
    
        # We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
>       resp = response_class(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: ClientResponse.__init__() missing 1 required keyword-only 
argument: 'stream_writer'

/usr/lib/python3/dist-packages/aioresponses/core.py:171: TypeError
--------------------------- snapshot report summary ----------------------------
4 snapshots unused.

Re-run pytest with --snapshot-update to delete unused snapshots.
=========================== short test summary info ============================
FAILED tests/test_client.py::test_providing_session - TypeError: ClientRespon...
FAILED tests/test_client.py::test_using_default_session - TypeError: ClientRe...
FAILED tests/test_client.py::test_device_list - TypeError: ClientResponse.__i...
FAILED tests/test_client.py::test_device_status[curtain] - TypeError: ClientR...
FAILED tests/test_client.py::test_device_status[curtain3] - TypeError: Client...
FAILED tests/test_client.py::test_device_status[hub_2] - TypeError: ClientRes...
FAILED tests/test_client.py::test_device_status_ir_remote - TypeError: Client...
========================= 7 failed, 1 passed in 0.30s ==========================
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m pytest --no-cov
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.14 
3.13" --parallel=2 returned exit code 13
make: *** [debian/rules:4: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit 
status 2
--------------------------------------------------------------------------------

Reply via email to