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

Automate generation of documentation/manpages #26

Closed
masc3d opened this issue Apr 29, 2016 · 11 comments
Closed

Automate generation of documentation/manpages #26

masc3d opened this issue Apr 29, 2016 · 11 comments

Comments

@masc3d
Copy link
Owner

masc3d commented Apr 29, 2016

could probably be implemented and integrated into setup.py using classes attached to this issue or another solution would be to use sphinx.

@masc3d masc3d self-assigned this Apr 29, 2016
@masc3d masc3d changed the title Automate generation of documentation Automate generation of documentation/manpages Apr 29, 2016
@syntonym
Copy link
Contributor

I've played a bit with sphinx and sphinxcontrib.autoprogram which convertes the argparse parser to rst. You can take a look at it here. There is a bit boilerplate for multiple man pages, which means when a new command is added, one would have to modify that. Alternativly one could simple put everything on a single man page, personally I didn't find that as useful/easy to read.

I've also exported to HTML, but I don't know if you want some docs in html format.

@masc3d
Copy link
Owner Author

masc3d commented Dec 8, 2016

If it can be fully automated, eg. including the conf.py it will be good.
The switches seem to be missing from the rsts, but I do like the idea and basic setup.

if you can provide a fully functional and automated integration with setup.py I will certainly merge this.

@syntonym
Copy link
Contributor

Do you mean that the documentation is automatically build when a user installs the package locally? Or that you don't have to care about the documentation, i.e. it is automatically build whenenver some change happens, and a user only needs to install the documentation (which is done via the setup.py script)? In the first case sphinx would be a hard requirement, which sounds rather bad.

What exactly do you mean with "including the conf.py"?

I will implement what I think makes sense and then you can take a look.

@masc3d
Copy link
Owner Author

masc3d commented Dec 14, 2016

I meant conf.py could probably also be generated, so that the entire mechanism only depends on argparse and integrates with setup.py.

I'm using python3 setup.py sdist upload for releasing a new version and it would be great if all docs, manpages etc. would be generated and included in the distribution in the process.

@syntonym
Copy link
Contributor

What about sphinx and sphinxcontrib.autoprogram as dependencies (for building the docs, ofcource not for endusers)? I guess the logic isn't too complex and could be extracted into a separate script, but if in the future anything should change sphinx has lots of features and is well documented.

@masc3d
Copy link
Owner Author

masc3d commented Dec 14, 2016

I don't see an issue with adding deps to the build toolchain

@syntonym
Copy link
Contributor

I can't really find a way to install man pages when installing via pip. I think pip transforms to wheels and wheels no longer can install to arbitrary locations. When packaged for package managers for distributions these could install the manpages. Do you still want to merge?

@masc3d
Copy link
Owner Author

masc3d commented Dec 27, 2016

never tried it. does this restriction apply even when installing with sudo/root?

@masc3d
Copy link
Owner Author

masc3d commented Dec 27, 2016

I have seen pip packages which install man pages, so there has to be a way. It has been discussed here eg..

@syntonym
Copy link
Contributor

Hm, you are right. This issue says that wheels can't handle absolute data files and the changelog of pip says "Build Wheels prior to installing from sdist, caching them in the pip cache directory to speed up subsequent installs. (PR #2618)". But installing one of the examples you linked via pip installs the man pages, so I guess something changed. Sorry for that.

@masc3d
Copy link
Owner Author

masc3d commented Mar 29, 2017

Merged into master, thanks!

@masc3d masc3d closed this as completed Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants