aristocratos / bpytop

Linux/OSX/FreeBSD resource monitor
Apache License 2.0
10.07k stars 397 forks source link

[BUG] Support Python 3.12 #404

Open chenrui333 opened 11 months ago

chenrui333 commented 11 months ago

Trying to build 1.0.68 with python 3.12, but ran into some issue with the test

error build log ``` 14/10/23 (23:09:30) | INFO: New instance of bpytop version 1.0.68 started with pid 7145 14/10/23 (23:09:30) | INFO: Loglevel set to DEBUG 14/10/23 (23:09:30) | DEBUG: Using psutil version 5.9.3 14/10/23 (23:09:30) | DEBUG: CMD: /opt/homebrew/Cellar/bpytop/1.0.68/bin/bpytop 14/10/23 (23:09:30) | ERROR: Exception while getting cpu frequency! 14/10/23 (23:09:30) | ERROR: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ)) Traceback (most recent call last): File \"/opt/homebrew/Cellar/bpytop/1.0.68/bin/bpytop\", line 3080, in _collect if CONFIG.show_cpu_freq and hasattr(psutil.cpu_freq(), \"current\"): ^^^^^^^^^^^^^^^^^ File \"/opt/homebrew/Cellar/bpytop/1.0.68/libexec/lib/python3.12/site-packages/psutil/__init__.py\", line 1864, in cpu_freq ret = _psplatform.cpu_freq() ^^^^^^^^^^^^^^^^^^^^^^ File \"/opt/homebrew/Cellar/bpytop/1.0.68/libexec/lib/python3.12/site-packages/psutil/_psosx.py\", line 179, in cpu_freq curr, min_, max_ = cext.cpu_freq() ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ)) 14/10/23 (23:09:30) | ERROR: could not convert string to float: 'Error: no SMC found\ 0.0' Traceback (most recent call last): File \"/opt/homebrew/Cellar/bpytop/1.0.68/bin/bpytop\", line 3228, in _collect_temps temp = max(0, round(float(subprocess.check_output(\"osx-cpu-temp\", universal_newlines=True).strip()[:-2]))) ```

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/6521604190/job/17710389287 relates to Homebrew/homebrew-core#150975

branchvincent commented 10 months ago

This is actually unrelated to 3.12, but osx-cpu-temp can log errors prior to the temperature like https://github.com/lavoiesl/osx-cpu-temp/blob/1.1.0/smc.c#L71 which then bpytop fails to parse as a float