Package: src:aiodukeenergy
Version: 1.1.0-1
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:aiodukeenergy, 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
   debian/rules override_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_build override_dh_auto_build --buildsystem=pybuild

[... snipped ...]

status = 200
body = b'{"access_token": 
"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiYXV0aDB8VEVTVCIsICJlbWFpbCI6ICJURVNUQEVYQU1QT...RVIiLCAiZXhwIjogMTc4MDk1OTczMH0.ZmFrZV9zaWduYXR1cmU",
 "internalUserID": "DUKE_TEST_USER", "email": "[email protected]"}'
content_type = 'application/json'
payload = {'access_token': 
'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiYXV0aDB8VEVTVCIsICJlbWFpbCI6ICJURVNUQEVYQU1QTEU...TRVIiLCAiZXhwIjogMTc4MDk1OTczMH0.ZmFrZV9zaWduYXR1cmU',
 'email': '[email protected]', 'internalUserID': 'DUKE_TEST_USER'}
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
______________________ TestAuth0Client.test_get_user_info ______________________

self = <tests.test_init.TestAuth0Client object at 0x7fcc54cd8190>

    @pytest.mark.asyncio
    async def test_get_user_info(self):
        """Test getting user info from Auth0."""
        from aiodukeenergy import Auth0Client
    
        async with aiohttp.ClientSession() as session:
            auth0 = Auth0Client(session)
    
            with aioresponses() as mocked:
                mocked.get(
                    "https://login.duke-energy.com/userinfo";,
                    payload={"email": "[email protected]", "sub": "user123"},
                )
    
>               user_info = await auth0.get_user_info("test_access_token")
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_init.py:1064: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
aiodukeenergy/auth0.py:297: in get_user_info
    response = await self.session.get(
<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 0x7fcc54ec3f50>
url = URL('https://login.duke-energy.com/userinfo'), method = 'get'
request_headers = {'Authorization': 'Bearer test_access_token'}, status = 200
body = b'{"email": "[email protected]", "sub": "user123"}'
content_type = 'application/json'
payload = {'email': '[email protected]', 'sub': 'user123'}, 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
___ TestDukeEnergyAuthTokenManagement.test_duke_token_with_server_issued_at ____

self = <tests.test_init.TestDukeEnergyAuthTokenManagement object at 
0x7fcc54cdd370>
mock_auth0_token_response = {'access_token': 
'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiYXV0aDB8VEVTVCIsICJlbWFpbCI6ICJURVNUQEVYQU1QTEU...OTczMCwgImRlX2F1dGgiOiAiZW5jcnlwdGVkX2F1dGhfZGF0YSJ9.ZmFrZV9zaWduYXR1cmU',
 'refresh_token': 'refresh_token_value', ...}

    @pytest.mark.asyncio
    async def test_duke_token_with_server_issued_at(self, 
mock_auth0_token_response):
        """Test Duke token exchange uses server's issued_at timestamp."""
        from aiodukeenergy import Auth0Client, DukeEnergyAuth
    
        async with aiohttp.ClientSession() as session:
            auth0 = Auth0Client(session)
            auth = DukeEnergyAuth(session, auth0)
    
            server_issued_at = 1700000000  # Fixed timestamp
    
            with aioresponses() as mocked:
                # Mock Auth0 token endpoint
                mocked.post(
                    "https://login.duke-energy.com/oauth/token";,
                    payload=mock_auth0_token_response,
                )
                # Mock Duke Energy API token exchange with server-provided 
issued_at
                mocked.post(
                    "https://api-v2.cma.duke-energy.app/login/auth-token";,
                    payload={
                        "access_token": "de_token",
                        "expires_in": 1800,
                        "issued_at": server_issued_at,
                    },
                )
    
>               await auth.authenticate_with_code("test_code", "verifier")

tests/test_init.py:1171: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
aiodukeenergy/duke_auth.py:392: in authenticate_with_code
    result = await self._auth0_client.exchange_code(code, code_verifier)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
aiodukeenergy/auth0.py:227: in exchange_code
    response = await self.session.post(
<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 0x7fcc54ec3590>
url = URL('https://login.duke-energy.com/oauth/token'), method = 'post'
request_headers = {'Content-Type': 'application/json; charset=utf-8', 
'User-Agent': 'Duke%20Energy/1241 CFNetwork/3860.300.31 Darwin/25....t': 
'eyJlbnYiOiB7ImlPUyI6ICIyNi4yIiwgInN3aWZ0IjogIjYueCJ9LCAidmVyc2lvbiI6ICIyLjEzLjAiLCAibmFtZSI6ICJBdXRoMC5zd2lmdCJ9'}
status = 200
body = b'{"access_token": 
"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiYXV0aDB8VEVTVCIsICJlbWFpbCI6ICJURVNUQEVYQU1QT...TczMCwgImRlX2F1dGgiOiAiZW5jcnlwdGVkX2F1dGhfZGF0YSJ9.ZmFrZV9zaWduYXR1cmU",
 "token_type": "Bearer", "expires_in": 86400}'
content_type = 'application/json'
payload = {'access_token': 
'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiYXV0aDB8VEVTVCIsICJlbWFpbCI6ICJURVNUQEVYQU1QTEU...OTczMCwgImRlX2F1dGgiOiAiZW5jcnlwdGVkX2F1dGhfZGF0YSJ9.ZmFrZV9zaWduYXR1cmU',
 'refresh_token': 'refresh_token_value', ...}
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
=============================== warnings summary ===============================
tests/test_init.py::TestUtilityFunctions::test_is_token_expired_no_exp_claim
  /usr/lib/python3/dist-packages/jwt/api_jwt.py:147: InsecureKeyLengthWarning: 
The HMAC key is 6 bytes long, which is below the minimum recommended length of 
32 bytes for SHA256. See RFC 7518 Section 3.2.
    return self._jws.encode(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_init.py::TestCodeExchange::test_authenticate_with_code - Ty...
FAILED tests/test_init.py::TestTokenRefresh::test_refresh_expired_token - Typ...
FAILED tests/test_init.py::TestAccountAPI::test_get_accounts - TypeError: Cli...
FAILED tests/test_init.py::TestAccountAPI::test_get_meters - TypeError: Clien...
FAILED tests/test_init.py::TestUsageAPI::test_hourly_energy_usage - TypeError...
FAILED tests/test_init.py::TestUsageAPI::test_daily_energy_usage - TypeError:...
FAILED tests/test_init.py::TestUsageAPI::test_energy_usage_duplicate_hours - ...
FAILED tests/test_init.py::TestErrorHandling::test_auth0_token_exchange_failure
FAILED 
tests/test_init.py::TestErrorHandling::test_duke_energy_token_exchange_failure
FAILED tests/test_init.py::TestErrorHandling::test_auth0_token_refresh_failure
FAILED 
tests/test_init.py::TestErrorHandling::test_get_energy_usage_invalid_serial_number
FAILED 
tests/test_init.py::TestErrorHandling::test_get_json_logs_error_body_on_failure
FAILED 
tests/test_init.py::TestErrorHandling::test_post_json_logs_error_body_on_failure
FAILED tests/test_init.py::TestAuth0Client::test_get_user_info - TypeError: C...
FAILED 
tests/test_init.py::TestDukeEnergyAuthTokenManagement::test_duke_token_with_server_issued_at
=================== 15 failed, 23 passed, 1 warning in 0.96s ===================
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:5: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit 
status 2
--------------------------------------------------------------------------------

Reply via email to