Unable to upgrade to 25.05 because paho-mqtt

Simply:

# nixos-rebuild switch  --upgrade --flake '.#hawat'  --update-input nixpkgs --commit-lock-file
# nix log /nix/store/pj9aly6gzxfkzzbznc26571sq1zy4cip-python3.11-paho-mqtt-2.1.0.drv

==================================== ERRORS ====================================
_________________ ERROR at teardown of test_01_will_unpwd_set __________________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}>
E           RuntimeError: Client 01-will-unpwd-set.py exited with code -2, expected 0

tests/lib/conftest.py:75: RuntimeError
----------------------------- Captured stderr call -----------------------------
/build/source/tests/lib/clients/01-will-unpwd-set.py:5: DeprecationWarning: Callback API version 1 is deprecated,>
  mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "01-will-unpwd-set")
--------------------------- Captured stderr teardown ---------------------------
Traceback (most recent call last):
  File "/build/source/tests/lib/clients/01-will-unpwd-set.py", line 9, in <module>
    mqttc.connect("localhost", get_test_server_port())
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    return self.reconnect()
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    return self._send_connect(self._keepalive)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    return self._packet_queue(command, packet, 0, 0)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    return self.loop_write()
           ^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self._packet_write()
         ^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    write_length = self._sock_send(
                   ^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    return self._sock.send(buf)
           ^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
_____________ ERROR at teardown of test_03_publish_helper_qos0_v5 ______________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}>
E           RuntimeError: Client 03-publish-helper-qos0-v5.py exited with code -2, expected 0

tests/lib/conftest.py:75: RuntimeError
--------------------------- Captured stderr teardown ---------------------------
Traceback (most recent call last):
  File "/build/source/tests/lib/clients/03-publish-helper-qos0-v5.py", line 7, in <module>
    paho.mqtt.publish.single(
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    multiple([msg], hostname, port, client_id, keepalive, will, auth, tls,
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    client.loop_forever()
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self._loop(timeout)
         ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self.loop_write()
         ^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self._packet_write()
         ^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    self._sock_close()
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    sock.close()
  File "/nix/store/m8f45f01p9dd16j9z70knqq7hbpd0jk5-python3-3.11.12/lib/python3.11/socket.py", line 503, in close
    self._real_close()
  File "/nix/store/m8f45f01p9dd16j9z70knqq7hbpd0jk5-python3-3.11.12/lib/python3.11/socket.py", line 497, in _real>
    _ss.close(self)
KeyboardInterrupt
_________ ERROR at teardown of test_03_publish_helper_qos1_disconnect __________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}>
E           RuntimeError: Client 03-publish-helper-qos1-disconnect.py exited with code -2, expected 0

tests/lib/conftest.py:75: RuntimeError
--------------------------- Captured stderr teardown ---------------------------
Traceback (most recent call last):
  File "/build/source/tests/lib/clients/03-publish-helper-qos1-disconnect.py", line 6, in <module>
    paho.mqtt.publish.single(
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    multiple([msg], hostname, port, client_id, keepalive, will, auth, tls,
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    client.loop_forever()
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self._loop(timeout)
         ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self.loop_write()
         ^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    rc = self._packet_write()
         ^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    write_length = self._sock_send(
                   ^^^^^^^^^^^^^^^^
  File "/nix/store/5bpgixvpcylnbvfc1kbdw1kk9v5anqz0-python3.11-paho-mqtt-2.1.0/lib/python3.11/site-packages/paho/>
    return self._sock.send(buf)
           ^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
=================================== FAILURES ===================================
________________ TestCompatibility.test_callback_v1_mqtt3[unix] ________________

self = <tests.test_client.TestCompatibility object at 0x7ffff5721350>
fake_broker = <tests.testsupport.broker.FakeBroker object at 0x7ffff58ff150>

    def test_callback_v1_mqtt3(self, fake_broker):
        callback_called = []
        with pytest.deprecated_call():
            mqttc = client.Client(
                CallbackAPIVersion.VERSION1,
                "client-id",
                userdata=callback_called,
                transport=fake_broker.transport,
...
>           assert callback_called == [
                "on_connect",
                "on_subscribe",
                "on_publish",
                "on_message",
                "on_unsubscribe",
                "on_disconnect",
            ]
E           AssertionError: assert ['on_connect'..._unsubscribe'] == ['on_connect'...n_disconnect']
E
E             Right contains one more item: 'on_disconnect'
E             Use -v to get more diff

tests/test_client.py:867: AssertionError
=========================== short test summary info ============================
XFAIL tests/lib/test_03_publish_fill_inflight.py::test_03_publish_fill_inflight
======== 1 failed, 161 passed, 1 xfailed, 3 errors in 144.62s (0:02:24) ========

Encountered this one myself while doing upgrade. It is the test suite of paho-mqtt that is failing. I worked around it be disabling package’s check phase. So, replace paho-mqtt with this:

      (paho-mqtt.overridePythonAttrs(attrs: {
        doCheck = false;
      }))

Thank you very much. I decided to wait with upgrade because there is another issues… Like recognize for nextcloud etc.