-
Notifications
You must be signed in to change notification settings - Fork 3
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
Automatic Man Page Installation Via Setup.py #3
Comments
Update: This feature wouldn't work with PIP, but it does with a manual setup.py install. This comes down to the fact that a manual setup.py install requires Super-User, but PIP does not. If we required running PIP as SU that would fix it, but that's not a great solution. We might be able to enable manpage installation via manual install but not on PIP installs but I'm not sure how to achieve that. |
Hi Ben! Thanks a lot for the suggestion! In fact, I read that very same thread on SO, there is even my comment from 3 weeks ago :) I still think that in general, if there is a system-wide installation, then the system installer is better than Since there is a package in AUR, why do you want to use You are right about permissions and user/root installation. Maybe it would be worth to add the manual to data files? At least the user won't need to download that her/himself! Or if they installed What do you think? |
I'm not an expert on packaging (I have only two of them, and only one for an OS, not only PyPI). So there might be good suggestions that I don't know yet. |
Everything you said I 100% agree with, I'm happy to close this issue if you want, but I'm also cool with leaving it here for now. Windows support for man page viewing is actually a really cool idea. Something like https://github.com/halprin/man-viewer except with cross-platform support would make a nice project. It would also alleviate some of the issues regarding UNIX permissions when installing man files as one could view them on a per-user basis. |
Thank you. I think this is an important issue, so it may stay until there is a good decision for that (or we completely abandon this). First, I'd like to write alternatives to man pages. I'd split them into two groups:
A variant of a local man is a CL option like --long-help. The downside of it is length (will require a pager?) and bad default formatting (for now, Thanks to Mikhail Zelenyy for these suggestions. Still, I'd like to ask you: why do you prefer |
Man page installation can be Local
Global
Common problem for local and global: NotesFor local installation one must also take into account virtual envirnoments. If mans are installed to a common directory, they will definitely conflict with each other (they report that users complain about that). In Python packaging they suggest using
For In 2015 for beetbox they wrote that BTW, many people asked ansible to provide a pdf, but it was not done yet. There is also a good suggestion to use both html + pdf (for different devices). Readthedocs would do it great (but one will still have to download the files manually). ansible uses a special command I think that a reasonable compromise could be:
|
Finally, I think that the standard Python help should be best (but, for user convenience, it must always be identical to the man page). However, I'd also like to add the aspect of uninstall. If a package was installed, it should be uninstalled without leaving any of its files (including mans). To properly uninstall a data file, some precautions must be made (to be done, if we plan to install for
For virtualenv (and maybe for any other install), it is written in req_install.py:
Not sure whether this is accurate (what about data files?..), but it can be an issue. For the moment, I think that Python |
I totally agree regarding the preference of using Python help above manpages or a wiki, but wouldn't it be somewhat possible to achieve highlighting in argparse as it's just a matter of using the right control characters when print()-ing. You could also make some modifications to argparse and use that version in this package, or if you don't mind ditching argparse I've heard https://github.com/docopt/docopt is a great alternative with rich text formatting in mind. As for why I prefer PIP over AUR installs, I find relying too much on the AUR to be quite a burden. Plus dealing with packaging relatively small OSS projects to any Linux distro to be a quite time consuming process which could be avoided with something like PIP (Maybe not, looking at some of these links you sent I'm second-guessing the usefulness of PIP) or a polished build/install script. |
The Oh-My-Zsh project comes to mind regarding really nice install methods that don't require distro-specific packages. They have a one-liner that runs a shell script in their repo that basicly automates the entire process. Below is the one-liner in question: sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" Having this be the prefered way to install would fix alot of the issues that come up when trying to have wider support for more distros, and it's not like YarSync needs a bunch of libraries, it's just a polished python script at the end of the day, so a shell script could work well if not better as an installation method, just a thought though. This could also allow for easier installation of manpages or any kind of documentation for that matter. Might be overkill though :) |
I tested Markdown with Python docstrings. Unfortunately, it seems not supported. Indeed, Python |
So, I created a readthedocs page: https://yarsync.readthedocs.io/ |
In the README, it states "Since there is no general way to install a manual page for a Python package, one has to do it manually.". I'm not sure this is entirely accurate as the
SetupTools.setup
function allows for adata_files
argument which provides the ability to install files to another location on the system. As this StackOverflow answer states, one could use this to install manpages. I've tested this and it works on my Arch Linux system, although I haven't tested it further than that. I'm happy to make a PR including this feature, but only if you think that this is a feature you would consider in this project.TLDR: It may be possible to automaticly install man pages via setup.py, is it worthwhile to pursue adding this as a feature?
The text was updated successfully, but these errors were encountered: