Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: show_config documentation #9312

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

Closed
wants to merge 19 commits into from
Closed

DOC: show_config documentation #9312

wants to merge 19 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 27, 2017

Continuing from #9275, fixing #9258

@rgommers @charris
I ended up going with your original suggestion and put the documentation in the packaging (distutils) section.

Final question:
Notice that because I have Numpy built on my machine, linkcode_resolve finds the source for show_config in __config__.py and produces a URL, which it then tries to follow on the master branch and obviously fails to locate it. Will this be an issue when you rebuild the html or is this fine?

@rgommers
Copy link
Member

I ended up going with your original suggestion and put the documentation in the packaging (distutils) section.

I think that choice is fine. However you now have duplicated the docstring content because of the difficulty of including it with autodoc.

The linkcode not resolving is an issue that's probably solvable, but I'm not too bothered right now - quite a bit of work for a very minor thing.

@ghost
Copy link
Author

ghost commented Jun 29, 2017

@rgommers

I removed the duplication by putting the documentation in an .rst file and reading it when generating __config__.py.

@rgommers
Copy link
Member

rgommers commented Jul 1, 2017

This works and docs look good to me. I have the feeling that this is going to break something though - that file reading doesn't look very robust. It's hard to predict how; for example packaging scripts could be stripping off doc/, which would break the build.

I've seen enough versions now that I've gotten a bit confused - could you remind me why the obvious solution (have the docstring inside generate_config_py, write it from there to __config__.py and adding `show_config` to reference/distutils.rst) didn't work?

@ghost
Copy link
Author

ghost commented Jul 1, 2017

The issue was that __config__.py and by extension show are generated during the build process, so Sphinx doesn't know about them prior to building the project.

@eric-wieser
Copy link
Member

Isn't this also true of any C function though?

@ghost
Copy link
Author

ghost commented Jul 1, 2017

I did stumble upon the add_doc helper for documenting C functions, as well as the convention of writing the function signature as the first line of the docstring.

I'll give these a go today.

@eric-wieser
Copy link
Member

I don't think "Sphinx doesn't know about them prior to building the project" is a good argument, as I think this is already true in many other places.

@ghost
Copy link
Author

ghost commented Jul 2, 2017

@eric-wieser as I am new to the project's source code, I would appreciate it if you could tell me where to look for something similar in the source, if you can think of such a place.

@eric-wieser
Copy link
Member

I'm saying that the suggestion to "have the docstring inside generate_config_py" seems correct to me, as suggested by @rgommers

Copy link
Member

@charris charris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a consensus that the way to do this is in generate_config_py.

@WarrenWeckesser
Copy link
Member

This pull request is superseded by #15429, so closing.

@WarrenWeckesser WarrenWeckesser removed the triage review Issue/PR to be discussed at the next triage meeting label Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants