d4nj1 / TLPUI

A GTK user interface for TLP written in Python
GNU General Public License v2.0
1.08k stars 83 forks source link

Build fails on Debian 12 Bookworm #115

Closed linuxazo closed 1 year ago

linuxazo commented 1 year ago

Dear Developer, thank You for your efforts.

konj@raga:~/builds/TLPUI$ python3 setup.py --command-packages=stdeb.command bdist_deb
/usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '1.5.0-5' to '1.5.0.post5'
  warnings.warn(tmpl.format(**locals()))
running bdist_deb
running sdist_dsc
running egg_info
creating TLPUI.egg-info
writing TLPUI.egg-info/PKG-INFO
writing dependency_links to TLPUI.egg-info/dependency_links.txt
writing entry points to TLPUI.egg-info/entry_points.txt
writing top-level names to TLPUI.egg-info/top_level.txt
writing manifest file 'TLPUI.egg-info/SOURCES.txt'
reading manifest file 'TLPUI.egg-info/SOURCES.txt'
adding license file 'LICENSE.md'
adding license file 'COPYING.md'
writing manifest file 'TLPUI.egg-info/SOURCES.txt'
Traceback (most recent call last):
  File "/home/konj/builds/TLPUI-tlpui-1.5.0-5/setup.py", line 4, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/stdeb/command/bdist_deb.py", line 34, in run
    self.run_command('sdist_dsc')
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/stdeb/command/sdist_dsc.py", line 30, in run
    debinfo = self.get_debinfo()
  File "/usr/lib/python3/dist-packages/stdeb/command/common.py", line 197, in get_debinfo
    debinfo = DebianInfo(
  File "/usr/lib/python3/dist-packages/stdeb/util.py", line 934, in __init__
    for line in long_description.split('\n'):
AttributeError: 'NoneType' object has no attribute 'split'
d4nj1 commented 1 year ago

Hi @linuxazo , I just added a long description which seems to be mandatory for some distros. Please try to build with latest master and report back if possible.

linuxazo commented 1 year ago

Dear @d4nj1 ,

Thanks to your prompt fix, I can confirm that your application builds just fine now and it creates a .deb package without errors. I had run tlpui with sudo, and all the functionality seems to be working. Immensely grateful for Your and team TLP efforts. I found tlp set of applications/scripts second to none when it comes to proper laptop power management under Linux these days.

When it comes to TLPUI, I can see that some improvements could be implemented. Namely PLATFORM_PROFILE support seems lacking: PLATFORM_PROFILE_ON_BAT in my laptops case is "quiet" and it is not selectable through TLPUI, rather I can only select "low-power" which is not present under available profiles in my machine.

Also I noticed that CPU_ENERGY_PERF_POLICY_ON_AC/BAT was already turned on by TLPUI even though, I did not use it in my tlp config file, simply because I have an AMD system, and those options are for Intel CPUs.

Just my five cents.

Wishing You a Happy New Year!

linuxazo commented 1 year ago

Also, on a further notice,

About storing settings, I am unsure if I can run tlp/tlpui as a regular non-root user and about the location of the config file. The default config file /etc/tlp.conf contains all available options commented out. My custom config file is under /etc/tlp.d/$HOSTNAME.conf and I only keep there the uncommented parameters that I actually use.

I see that TLPUI when run as sudo tlpui (the only way it works on my system, afaik), uses /etc/tlp.conf for storing its configuration.

Would it be possible to have it accept other config file location, like the one I am using? Together with the ability to parse the custom config file.

Just because it would be good to keep the default config file commented out for reference since some options are added/removed with new releases of TLP.

Thanks anyhow and regards!

d4nj1 commented 1 year ago

When it comes to TLPUI, I can see that some improvements could be implemented. Namely PLATFORM_PROFILE support seems lacking: PLATFORM_PROFILE_ON_BAT in my laptops case is "quiet" and it is not selectable through TLPUI, rather I can only select "low-power" which is not present under available profiles in my machine.

I only support what is officially documented, see https://linrunner.de/tlp/settings/platform.html Maybe create a request at TLP for an extra quiet value.

Also I noticed that CPU_ENERGY_PERF_POLICY_ON_AC/BAT was already turned on by TLPUI even though, I did not use it in my tlp config file, simply because I have an AMD system, and those options are for Intel CPUs.

There might be some intrinsic defaults that TLP automatically applies even though they are not supported in the actual running environment. I can only reference to the official TLP documenation mentioned above.

Just my five cents.

Constructive feedback is always welcome! ;)

Wishing You a Happy New Year!

Thanks, I wish you to also have a good start.

d4nj1 commented 1 year ago

About storing settings, I am unsure if I can run tlp/tlpui as a regular non-root user and about the location of the config file. The default config file /etc/tlp.conf contains all available options commented out. My custom config file is under /etc/tlp.d/$HOSTNAME.conf and I only keep there the uncommented parameters that I actually use.

I see that TLPUI when run as sudo tlpui (the only way it works on my system, afaik), uses /etc/tlp.conf for storing its configuration.

Would it be possible to have it accept other config file location, like the one I am using? Together with the ability to parse the custom config file.

Just because it would be good to keep the default config file commented out for reference since some options are added/removed with new releases of TLP.

You are right with your opinion, due to historic reasons and after the update to TLP 1.3 the handling of config files has changed. Ideally nowadays all user configs changes should be applied in /etc/tlp.d/*.conf and not in /etc/tlp.conf anymore.

As TLPUI is/was my first bigger open-source project and refactoring everything probably will be painfull, I am currently thinking about a rewrite of the UI with not only the ability to add multiple configuration files, but also to be able to use maybe profiles for different work situations. Battery conservation is also a topic (#102) and furthermore beeing UI compatible with mobile devices (#111)

That beeing said my biggest issue is as always time. I did not win the lottery yet so I still have to work as an employee and also private life does not offer much free time atm.

I will close the issue for now. Feel free open another issue whenever you encounter anything not working as expected.

Kind regards