erpalma / throttled

Workaround for Intel throttling issues in Linux.
MIT License
2.68k stars 166 forks source link

Service incompatible with Python 3.13 #366

Open picdc opened 3 weeks ago

picdc commented 3 weeks ago

Fedora 41 ships with Python 3.13, which results in a failure when compiling the service (sudo ./install.sh):

> sudo ./install.sh
...
      gi/pygi-resulttuple.c: In function ‘resulttuple_dealloc’:
      gi/pygi-resulttuple.c:312:5: error: implicit declaration of function ‘Py_TRASHCAN_SAFE_BEGIN’; did you mean ‘Py_TRASHCAN_BEGIN’? [-Wimplicit-function-declaration]
        312 |     Py_TRASHCAN_SAFE_BEGIN (self)
            |     ^~~~~~~~~~~~~~~~~~~~~~
            |     Py_TRASHCAN_BEGIN
      gi/pygi-resulttuple.c:312:5: warning: nested extern declaration of ‘Py_TRASHCAN_SAFE_BEGIN’ [-Wnested-externs]
      gi/pygi-resulttuple.c:312:34: error: expected ‘;’ before ‘len’
        312 |     Py_TRASHCAN_SAFE_BEGIN (self)
            |                                  ^
            |                                  ;
      ......
        317 |     len = Py_SIZE (self);
            |     ~~~
      gi/pygi-resulttuple.c:334:5: error: implicit declaration of function ‘Py_TRASHCAN_SAFE_END’; did you mean ‘Py_TRASHCAN_END’? [-Wimplicit-function-declaration]
        334 |     Py_TRASHCAN_SAFE_END (self)
            |     ^~~~~~~~~~~~~~~~~~~~
            |     Py_TRASHCAN_END
      gi/pygi-resulttuple.c:334:5: warning: nested extern declaration of ‘Py_TRASHCAN_SAFE_END’ [-Wnested-externs]
      gi/pygi-resulttuple.c:334:32: error: expected ‘;’ before ‘}’ token
        334 |     Py_TRASHCAN_SAFE_END (self)
            |                                ^
            |                                ;
        335 | }
            | ~
      At top level:
      cc1: note: unrecognized command-line option ‘-Wno-unused-command-line-argument’ may have been intended to silence earlier diagnostics
      cc1: note: unrecognized command-line option ‘-Wno-incompatible-pointer-types-discards-qualifiers’ may have been intended to silence earlier diagnostics
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for PyGObject
Failed to build PyGObject

This is due to the version of PyGObject that is unfortunately too old for Python 3.13. Forcing it to 3.48.2 in requirements.txt (the one packaged in Fedora 41 at the moment) works perfectly.

I'm not an expert (at all) on Python dependency so I'm not sure how to handle it so that it works for multiple versions of Python.

picdc commented 3 weeks ago

It is actually resolved by #357