-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix and make project structure more Python packaging idiomatic, making it easier for downstream packagers to package dool #80
base: master
Are you sure you want to change the base?
Conversation
The project structure and the pyproject.toml would only cause the dool.py script to be installed, not the plugins. To make it easier for downstream packages, like Gentoo in my case, dool should use an idiomatic Python project structure. This change moves the files accordingly, adds a __init__.py (as recommended by flit), and adjusts pyproject.toml accordingly.
A flit installation will put the dool module into the site-packages directory, for example/usr/lib/python3.12/site-packages/dool/plugins/. Therefore, dool should also look there for its plugins.
Wow... At it's core
For the RPM we do #2. |
FWIW, I'm in favor of this. this is the reason why #74 needs a whole I guess I don't understand why the emphasis is on "optional". if you install dool through your package manager, there isn't really a way to install plugins unless they come with the base package or you package the plugins separately. but there isn't a reasonable way to package the plugins either I think we should package the plugins with dool together. changing the structure here would mean I could get rid of what is the issue with moving the plugins to |
I understand your desire to keep things as they are. But the current state causes a lot of friction, downstream and elsewhere. Switching to an idiomatic format would help. Also, it certainly would encourage to continue packing dool on Gentoo. Furthermore, I don't understand the optional aspect of the bundled plugins. Why would it be sensible to make them optional and not simply always install them when you install the main script on Linux? |
I'm a big fan of the K.I.S.S principal. I did not write 90% of I say the plugins are optional because I think 95% of users (myself included) almost never use the plugins. The stuff in the plugins folder is for corner case and niche applications. If it was something used by a lot of people I would move it into core. Complicating how I guess I just don't fully understand how best to package/build a Python application? I took this on a hack because I liked Again, I think for 95% of users just putting |
It's also worth noting that #38 has been around a while but I haven't decided how/if we want to move forward with that. Dool already checks in these directories for plugins:
I'm hesitant to add a bunch of directories to this as it slows down and complicates things a bit. |
I am sorry, that is not at all required.. I guess I did it just by habit. If you project grows a I am very sympathetic towards you KISS approach. However, and the following is written with Gentoo packaging in mind, the current state of dool makes it more cumbersome to package it. If dool would simply use flit to perform its installation, then packaging, at least from the Gentoo perspective, would as easy as it gets (because Gentoo tooling will automatically do the right thing™).
Please consider at least merging 5c53854. Looking in the purelib path for plugins is sensible for systemd-wide installations that support multiple Python versions. Frankly, I doubt that the additional directory lookups would case a noticeable slowdown. And the additional complexity is restricted to another entry to a list. Thanks for working on dool. I really liked dstat and was very happy to see that it got forked as dool. |
Gentoo downstream here. Thanks for working on dool. However, the currently project structure makes it hard to package dool in Gentoo (and I believe this is true for other distributions as well).
This PR makes the project structure more Python and flit idiomatic, reducing a lot of friction when packaging dool.
Note that I did not adjust
Makefile
, as there are multiple ways forward.