Package: src:python-keycloak
Version: 4.6.2+dfsg-1
Severity: serious
Tags: ftbfs trixie sid

Dear maintainer:

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

--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
   debian/rules execute_after_dh_auto_clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
sed -i -e "/^version =/c version = \"0.0.0\"" /<<PKGBUILDDIR>>/pyproject.toml
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   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 execute_before_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
sed -i -e "/^version =/c version = \"4.6.2\"" /<<PKGBUILDDIR>>/pyproject.toml
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   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_keycloak  
* Building wheel...
Successfully built python_keycloak-4.6.2-py3-none-any.whl
I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.13 with 
"installer" module
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
export KEYCLOAK_ADMIN=admin; export KEYCLOAK_ADMIN_PASSWORD=admin; export 
KEYCLOAK_HOST=localhost; export KEYCLOAK_PORT=8080; dh_auto_test
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_keycloak/build; 
python3.13 -m pytest --ignore=tests/test_keycloak_admin.py 
--ignore=tests/test_keycloak_uma.py --ignore=tests/test_keycloak_openid.py
============================= test session starts ==============================
platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_keycloak/build
configfile: pyproject.toml
plugins: cov-5.0.0, anyio-4.8.0, typeguard-4.4.2
collected 36 items

tests/test_authorization.py .                                            [  2%]
tests/test_connection.py FFF.                                            [ 13%]
tests/test_exceptions.py .                                               [ 16%]
tests/test_license.py .                                                  [ 19%]
tests/test_uma_permissions.py ............................               [ 97%]
tests/test_urls_patterns.py .                                            [100%]

=================================== FAILURES ===================================
____________________________ test_connection_proxy _____________________________

    def test_connection_proxy():
        """Test proxies of connection manager."""
>       cm = ConnectionManager(
            base_url="http://test.test";, proxies={"http://test.test": 
"http://localhost:8080"}
        )

tests/test_connection.py:13: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <keycloak.connection.ConnectionManager object at 0x7fa58ec24440>
base_url = 'http://test.test', headers = {}, timeout = 60, verify = True
proxies = {'http://test.test': 'http://localhost:8080'}, cert = None
max_retries = 1

    def __init__(
        self, base_url, headers={}, timeout=60, verify=True, proxies=None, 
cert=None, max_retries=1
    ):
        """Init method.
    
        :param base_url: The server URL.
        :type base_url: str
        :param headers: The header parameters of the requests to the server.
        :type headers: dict
        :param timeout: Timeout to use for requests to the server.
        :type timeout: int
        :param verify: Boolean value to enable or disable certificate 
validation or a string
            containing a path to a CA bundle to use
        :type verify: Union[bool,str]
        :param proxies: The proxies servers requests is sent by.
        :type proxies: dict
        :param cert: An SSL certificate used by the requested host to 
authenticate the client.
            Either a path to an SSL certificate file, or two-tuple of
            (certificate file, key file).
        :type cert: Union[str,Tuple[str,str]]
        :param max_retries: The total number of times to retry HTTP requests.
        :type max_retries: int
        """
        self.base_url = base_url
        self.headers = headers
        self.timeout = timeout
        self.verify = verify
        self.cert = cert
        self._s = requests.Session()
        self._s.auth = lambda x: x  # don't let requests add auth headers
    
        # retry once to reset connection with Keycloak after  tomcat's 
ConnectionTimeout
        # see https://github.com/marcospereirampj/python-keycloak/issues/36
        for protocol in ("https://";, "http://";):
            adapter = HTTPAdapter(max_retries=max_retries)
            # adds POST to retry whitelist
            allowed_methods = set(adapter.max_retries.allowed_methods)
            allowed_methods.add("POST")
            adapter.max_retries.allowed_methods = frozenset(allowed_methods)
    
            self._s.mount(protocol, adapter)
    
        if proxies:
            self._s.proxies.update(proxies)
    
>       self.async_s = httpx.AsyncClient(verify=verify, proxies=proxies, 
> cert=cert)
E       TypeError: AsyncClient.__init__() got an unexpected keyword argument 
'proxies'

keycloak/connection.py:105: TypeError
_________________________________ test_headers _________________________________

    def test_headers():
        """Test headers manipulation."""
>       cm = ConnectionManager(base_url="http://test.test";, headers={"H": "A"})

tests/test_connection.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <keycloak.connection.ConnectionManager object at 0x7fa58eb40550>
base_url = 'http://test.test', headers = {'H': 'A'}, timeout = 60, verify = True
proxies = None, cert = None, max_retries = 1

    def __init__(
        self, base_url, headers={}, timeout=60, verify=True, proxies=None, 
cert=None, max_retries=1
    ):
        """Init method.
    
        :param base_url: The server URL.
        :type base_url: str
        :param headers: The header parameters of the requests to the server.
        :type headers: dict
        :param timeout: Timeout to use for requests to the server.
        :type timeout: int
        :param verify: Boolean value to enable or disable certificate 
validation or a string
            containing a path to a CA bundle to use
        :type verify: Union[bool,str]
        :param proxies: The proxies servers requests is sent by.
        :type proxies: dict
        :param cert: An SSL certificate used by the requested host to 
authenticate the client.
            Either a path to an SSL certificate file, or two-tuple of
            (certificate file, key file).
        :type cert: Union[str,Tuple[str,str]]
        :param max_retries: The total number of times to retry HTTP requests.
        :type max_retries: int
        """
        self.base_url = base_url
        self.headers = headers
        self.timeout = timeout
        self.verify = verify
        self.cert = cert
        self._s = requests.Session()
        self._s.auth = lambda x: x  # don't let requests add auth headers
    
        # retry once to reset connection with Keycloak after  tomcat's 
ConnectionTimeout
        # see https://github.com/marcospereirampj/python-keycloak/issues/36
        for protocol in ("https://";, "http://";):
            adapter = HTTPAdapter(max_retries=max_retries)
            # adds POST to retry whitelist
            allowed_methods = set(adapter.max_retries.allowed_methods)
            allowed_methods.add("POST")
            adapter.max_retries.allowed_methods = frozenset(allowed_methods)
    
            self._s.mount(protocol, adapter)
    
        if proxies:
            self._s.proxies.update(proxies)
    
>       self.async_s = httpx.AsyncClient(verify=verify, proxies=proxies, 
> cert=cert)
E       TypeError: AsyncClient.__init__() got an unexpected keyword argument 
'proxies'

keycloak/connection.py:105: TypeError
_____________________________ test_bad_connection ______________________________

    def test_bad_connection():
        """Test bad connection."""
>       cm = ConnectionManager(base_url="http://not.real.domain";)

tests/test_connection.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <keycloak.connection.ConnectionManager object at 0x7fa58eb41bd0>
base_url = 'http://not.real.domain', headers = {}, timeout = 60, verify = True
proxies = None, cert = None, max_retries = 1

    def __init__(
        self, base_url, headers={}, timeout=60, verify=True, proxies=None, 
cert=None, max_retries=1
    ):
        """Init method.
    
        :param base_url: The server URL.
        :type base_url: str
        :param headers: The header parameters of the requests to the server.
        :type headers: dict
        :param timeout: Timeout to use for requests to the server.
        :type timeout: int
        :param verify: Boolean value to enable or disable certificate 
validation or a string
            containing a path to a CA bundle to use
        :type verify: Union[bool,str]
        :param proxies: The proxies servers requests is sent by.
        :type proxies: dict
        :param cert: An SSL certificate used by the requested host to 
authenticate the client.
            Either a path to an SSL certificate file, or two-tuple of
            (certificate file, key file).
        :type cert: Union[str,Tuple[str,str]]
        :param max_retries: The total number of times to retry HTTP requests.
        :type max_retries: int
        """
        self.base_url = base_url
        self.headers = headers
        self.timeout = timeout
        self.verify = verify
        self.cert = cert
        self._s = requests.Session()
        self._s.auth = lambda x: x  # don't let requests add auth headers
    
        # retry once to reset connection with Keycloak after  tomcat's 
ConnectionTimeout
        # see https://github.com/marcospereirampj/python-keycloak/issues/36
        for protocol in ("https://";, "http://";):
            adapter = HTTPAdapter(max_retries=max_retries)
            # adds POST to retry whitelist
            allowed_methods = set(adapter.max_retries.allowed_methods)
            allowed_methods.add("POST")
            adapter.max_retries.allowed_methods = frozenset(allowed_methods)
    
            self._s.mount(protocol, adapter)
    
        if proxies:
            self._s.proxies.update(proxies)
    
>       self.async_s = httpx.AsyncClient(verify=verify, proxies=proxies, 
> cert=cert)
E       TypeError: AsyncClient.__init__() got an unexpected keyword argument 
'proxies'

keycloak/connection.py:105: TypeError
=============================== warnings summary ===============================
tests/test_connection.py:46
  
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_keycloak/build/tests/test_connection.py:46:
 PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You 
can register custom marks to avoid this warning - for details, see 
https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.asyncio

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_connection.py::test_connection_proxy - TypeError: AsyncClie...
FAILED tests/test_connection.py::test_headers - TypeError: AsyncClient.__init...
FAILED tests/test_connection.py::test_bad_connection - TypeError: AsyncClient...
=================== 3 failed, 33 passed, 1 warning in 0.07s ====================
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_keycloak/build; python3.13 -m pytest 
--ignore=tests/test_keycloak_admin.py --ignore=tests/test_keycloak_uma.py 
--ignore=tests/test_keycloak_openid.py
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.13 
returned exit code 13
make[1]: *** [debian/rules:25: override_dh_auto_test] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:12: binary] Error 2
dpkg-buildpackage: error: debian/rules binary 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/202503/

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 add an affects on src:python-keycloak, so that this is still
visible in the BTS web page for this package.

Thanks.

Reply via email to