Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROPOSAL] Public poll - Standard pip installation #73

Open
leopoldhub opened this issue Aug 19, 2024 · 6 comments
Open

[PROPOSAL] Public poll - Standard pip installation #73

leopoldhub opened this issue Aug 19, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@leopoldhub
Copy link
Collaborator

leopoldhub commented Aug 19, 2024

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 😉

@leopoldhub leopoldhub added the enhancement New feature or request label Aug 19, 2024
@leopoldhub leopoldhub pinned this issue Aug 19, 2024
@leopoldhub leopoldhub added the question Further information is requested label Aug 19, 2024
@Svenum
Copy link
Contributor

Svenum commented Aug 19, 2024

The packaging/nix already uses this:

preBuild = ''
cat > setup.py << EOF
from setuptools import setup
setup(
name="fw-fanctrl",
description="${description}",
url="${url}",
platforms=["linux"],
py_modules=[],
scripts=[
"fanctrl.py",
],
)
EOF
'';

So it sounds good to me.

@leopoldhub
Copy link
Collaborator Author

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
Copy link
Contributor

Svenum commented Aug 20, 2024

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

@leopoldhub
Copy link
Collaborator Author

Thanks

@TamtamHero
Copy link
Owner

That's fine by me 👍

@deifactor
Copy link

For what it's worth, pip install-ing a Python script means that now you're dealing with installing all the dependencies into a shared package environment, which is messy. pipx --global is probably better (I haven't used it with --global, but I've used it for user scripts and it's worked great).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants