TamtamHero / fw-fanctrl

A simple systemd service to better control Framework Laptop's fan(s)
BSD 3-Clause "New" or "Revised" License
186 stars 35 forks source link

[PROPOSAL] Public poll - Standard pip installation #73

Open leopoldhub opened 4 weeks ago

leopoldhub commented 4 weeks ago

Hi,

Currently, the installation process manually moves the Python script to /usr/bin/fw-fanctrl (or other configured path). This is a manual non-standard process that is only valid for single-file scripts.

I think that we should use the "standard" way of doing this with a setup.py file descriptor and install it with pip install instead.

This method uses the setuptools. Several formats for the setup file are available pyproject.toml, setup.cfg and setup.py. The exact format is yet to be decided.

This would allow us to split the already large (633 lines) script file into modules, as well as allow for versioning and possible future dependencies and developement dependencies (e.g. a file formatter or tests to ensure uniformity and stability).

What do you think about this this?

This is a public poll, feel free to give your opinion and discuss this proposal even if you are not an active developer on this project 😉

Svenum commented 4 weeks ago

The packaging/nix already uses this: https://github.com/TamtamHero/fw-fanctrl/blob/c79c43e566d46b1767fa5af95d36f5a7049b3818/nix/packages/fw-fanctrl.nix#L24-L40

So it sounds good to me.

leopoldhub commented 4 weeks ago

Hi @Svenum,

Thanks for your feedback.

Nice to see that this is already being used in some way!

What do you think about other formats, and why did you choose the setup.py one?

Svenum commented 4 weeks ago

I used it as it is the recommended way from nixos to package a python package. Thats the only reason.

leopoldhub commented 4 weeks ago

Thanks

TamtamHero commented 1 week ago

That's fine by me :+1: