Package: src:python-easyenergy
Version: 2.1.2-1
Severity: serious
Tags: ftbfs

Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:

[ Note: This build was done using the unshare backend of sbuild, which is
  already the default mode used by the buildds and usually catches
  these kind of problems automatically ].

--------------------------------------------------------------------------------
[...]
 debian/rules build
make: pyversions: No such file or directory
py3versions: no X-Python3-Version in control file, using supported versions
dh build --buildsystem=pybuild --with python3
   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:129: Building wheel for python3.13 with "build" 
module
I: pybuild base:311: python3.13 -m build --skip-dependency-check --no-isolation --wheel 
--outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13
* Building wheel...
Successfully built easyenergy-0.0.0-py3-none-any.whl
I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.13 with 
"installer" module
I: pybuild plugin_pyproject:129: Building wheel for python3.12 with "build" 
module

[... snipped ...]

    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
          result = await dns.query(API_HOST, "A")
E           aiodns.error.DNSError: (11, 'Could not contact DNS servers')

easyenergy/easyenergy.py:72: DNSError

The above exception was the direct cause of the following exception:

aresponses = <aresponses.main.ResponsesMockServer object at 0x7f6b38ffe3c0>

    @pytest.mark.freeze_time("2022-12-14 15:00:00+01:00")
    async def test_gas_model(aresponses: ResponsesMockServer) -> None:
        """Test the gas model - easyEnergy at 15:00:00 CET."""
        aresponses.add(
            "mijn.easyenergy.com",
            "/nl/api/tariff/getlebatariffs",
            "GET",
            aresponses.Response(
                status=200,
                headers={"Content-Type": "application/json"},
                text=load_fixtures("gas.json"),
            ),
        )
        async with ClientSession() as session:
            today = date(2022, 12, 14)
            client = EasyEnergy(session=session)
          gas: Gas = await client.gas_prices(
                start_date=today,
                end_date=today,
                vat=VatOption.INCLUDE,
            )

tests/test_models.py:185:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
easyenergy/easyenergy.py:193: in gas_prices
    data = await self._request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b38fff980>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
            result = await dns.query(API_HOST, "A")
        except DNSError as err:
            msg = "Error while resolving EasyEnergy API IPv4 address"
          raise EasyEnergyConnectionError(msg) from err
E           easyenergy.exceptions.EasyEnergyConnectionError: Error while 
resolving EasyEnergy API IPv4 address

easyenergy/easyenergy.py:75: EasyEnergyConnectionError
____________________________ test_gas_morning_model ____________________________

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b39068b90>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
          result = await dns.query(API_HOST, "A")
E           aiodns.error.DNSError: (11, 'Could not contact DNS servers')

easyenergy/easyenergy.py:72: DNSError

The above exception was the direct cause of the following exception:

aresponses = <aresponses.main.ResponsesMockServer object at 0x7f6b38fff6e0>

    @pytest.mark.freeze_time("2022-12-14 04:00:00+01:00")
    async def test_gas_morning_model(aresponses: ResponsesMockServer) -> None:
        """Test the gas model in the morning - easyEnergy at 04:00:00 CET."""
        aresponses.add(
            "mijn.easyenergy.com",
            "/nl/api/tariff/getlebatariffs",
            "GET",
            aresponses.Response(
                status=200,
                headers={"Content-Type": "application/json"},
                text=load_fixtures("gas.json"),
            ),
        )
        async with ClientSession() as session:
            today = date(2022, 12, 14)
            client = EasyEnergy(session=session)
          gas: Gas = await client.gas_prices(
                start_date=today,
                end_date=today,
                vat=VatOption.INCLUDE,
            )

tests/test_models.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
easyenergy/easyenergy.py:193: in gas_prices
    data = await self._request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b39068b90>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
            result = await dns.query(API_HOST, "A")
        except DNSError as err:
            msg = "Error while resolving EasyEnergy API IPv4 address"
          raise EasyEnergyConnectionError(msg) from err
E           easyenergy.exceptions.EasyEnergyConnectionError: Error while 
resolving EasyEnergy API IPv4 address

easyenergy/easyenergy.py:75: EasyEnergyConnectionError
______________________________ test_gas_none_data ______________________________

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b38fff8f0>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
          result = await dns.query(API_HOST, "A")
E           aiodns.error.DNSError: (11, 'Could not contact DNS servers')

easyenergy/easyenergy.py:72: DNSError

The above exception was the direct cause of the following exception:

aresponses = <aresponses.main.ResponsesMockServer object at 0x7f6b38fffa40>

    async def test_gas_none_data(aresponses: ResponsesMockServer) -> None:
        """Test when there is no data for the current datetime."""
        aresponses.add(
            "mijn.easyenergy.com",
            "/nl/api/tariff/getlebatariffs",
            "GET",
            aresponses.Response(
                status=200,
                headers={"Content-Type": "application/json"},
                text=load_fixtures("gas.json"),
            ),
        )
        async with ClientSession() as session:
            today = date(2022, 12, 14)
            client = EasyEnergy(session=session)
          gas: Gas = await client.gas_prices(start_date=today, end_date=today)

tests/test_models.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
easyenergy/easyenergy.py:193: in gas_prices
    data = await self._request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b38fff8f0>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
            result = await dns.query(API_HOST, "A")
        except DNSError as err:
            msg = "Error while resolving EasyEnergy API IPv4 address"
          raise EasyEnergyConnectionError(msg) from err
E           easyenergy.exceptions.EasyEnergyConnectionError: Error while 
resolving EasyEnergy API IPv4 address

easyenergy/easyenergy.py:75: EasyEnergyConnectionError
_______________________________ test_no_gas_data _______________________________

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b38ffdb20>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
          result = await dns.query(API_HOST, "A")
E           aiodns.error.DNSError: (11, 'Could not contact DNS servers')

easyenergy/easyenergy.py:72: DNSError

The above exception was the direct cause of the following exception:

aresponses = <aresponses.main.ResponsesMockServer object at 0x7f6b38ffc5c0>

    async def test_no_gas_data(aresponses: ResponsesMockServer) -> None:
        """Test when there is no gas data."""
        aresponses.add(
            "mijn.easyenergy.com",
            "/nl/api/tariff/getlebatariffs",
            "GET",
            aresponses.Response(
                status=200,
                headers={"Content-Type": "application/json"},
                text="[]",
            ),
        )
        async with ClientSession() as session:
            today = date(2022, 12, 16)
            client = EasyEnergy(session=session)
            with pytest.raises(EasyEnergyNoDataError):
              await client.gas_prices(start_date=today, end_date=today)

tests/test_models.py:266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
easyenergy/easyenergy.py:193: in gas_prices
    data = await self._request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = EasyEnergy(vat=<VatOption.INCLUDE: 'true'>, request_timeout=10.0, 
session=<aiohttp.client.ClientSession object at 0x7f6b38ffdb20>, _close_session=False)
uri = 'getlebatariffs'

    async def _request(
        self,
        uri: str,
        *,
        method: str = METH_GET,
        params: dict[str, Any] | None = None,
    ) -> Any:
        """Handle a request to the API of easyEnergy.
Args:
        ----
            uri: Request URI, without '/', for example, 'status'
            method: HTTP method to use, for example, 'GET'
            params: Extra options to improve or limit the response.
Returns:
        -------
            A Python dictionary (json) with the response from easyEnergy.
Raises:
        ------
            EasyEnergyConnectionError: An error occurred while
                communicating with the API.
            EasyEnergyError: Received an unexpected response from
                the API.
"""
        # EasyEnergy is experiencing IPv6 connection issues.
        # DNS returns an AAAA record with an IPv6 address, but
        # there doesn't appear to be something listening at that.
        # Workaround is to resolve the IPv4 address and use that.
        dns = DNSResolver()
        try:
            result = await dns.query(API_HOST, "A")
        except DNSError as err:
            msg = "Error while resolving EasyEnergy API IPv4 address"
          raise EasyEnergyConnectionError(msg) from err
E           easyenergy.exceptions.EasyEnergyConnectionError: Error while 
resolving EasyEnergy API IPv4 address

easyenergy/easyenergy.py:75: EasyEnergyConnectionError

---------- coverage: platform linux, python 3.12.7-final-0 -----------
Name                       Stmts   Miss Branch BrPart  Cover   Missing
----------------------------------------------------------------------
easyenergy/easyenergy.py      82     30     20      2    57%   81-123, 202-205, 
259-262, 267
easyenergy/models.py         115     53     64      0    61%   26-31, 50, 67, 
89, 100, 111, 125, 139, 150, 161, 172, 183, 194, 205-206, 217-218, 229, 240, 
251-252, 263-264, 274, 291-297, 312-321, 342, 353, 364, 375, 385, 399-402, 
417-423
----------------------------------------------------------------------
TOTAL                        212     83     84      2    62%

3 files skipped due to complete coverage.

FAIL Required test coverage of 90.0% not reached. Total coverage: 61.82%
=========================== short test summary info ============================
FAILED tests/test_easyenergy.py::test_json_request - easyenergy.exceptions.Ea...
FAILED tests/test_easyenergy.py::test_internal_session - easyenergy.exception...
FAILED tests/test_models.py::test_electricity_model_usage - easyenergy.except...
FAILED tests/test_models.py::test_electricity_model_return - easyenergy.excep...
FAILED tests/test_models.py::test_electricity_midnight - easyenergy.exception...
FAILED tests/test_models.py::test_electricity_none_data - easyenergy.exceptio...
FAILED tests/test_models.py::test_no_electricity_data - easyenergy.exceptions...
FAILED tests/test_models.py::test_gas_model - easyenergy.exceptions.EasyEnerg...
FAILED tests/test_models.py::test_gas_morning_model - easyenergy.exceptions.E...
FAILED tests/test_models.py::test_gas_none_data - easyenergy.exceptions.EasyE...
FAILED tests/test_models.py::test_no_gas_data - easyenergy.exceptions.EasyEne...
========================= 11 failed, 5 passed in 0.32s =========================
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build; python3.12 -m pytest -v tests
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.13 
3.12" returned exit code 13
make: *** [debian/rules:9: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:

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

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 could not 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 affects, so that this is still visible in the BTS web
page for this package.

Thanks.

Reply via email to