-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 docs datastore examples #2039
Fix docs datastore examples #2039
Conversation
|
||
if element.docstring: | ||
if not isinstance(element, pdoc.Class) and element.cls: | ||
cls = element.cls.cls | ||
clas = element.cls.cls |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We have until now curated all the |
I agree with you there. That's probably a bigger topic than this PR though. |
Slowly bringing the two approaches in sync would've been the right move. There is a way (one that is employed by |
I'm not really following I guess.
Creates RST files with the autodoc directives in them. I guess you could grab the module references from that? But that's not a huge win in this case I don't think? I could be wrong or missing something though. |
The point is that in that regime we don't care what is in the RST files. Using |
Basically instead of |
I'm not referring to your handrolled solution, so |
The In anycase, I moved the example code to |
That sounds fine, we should have an issue for this discussion. Your docstring changes seem fine, how should I vet the docgen stuff in |
Sure, although I made #2043 to talk about what I think you were saying before. |
Thanks |
9101b26
to
72e5823
Compare
@dhermes, I didn't delete the docs from connection.py. I thought it would be good to leave it for now. Otherwise I think I got the other issues you mentioned. |
3dc290f
to
75baf31
Compare
|
||
# Hack for old-style classes | ||
if str(cls)[0] != '<': | ||
cls = '<class \'' + str(cls) + '\'>' | ||
if str(klass)[0] != '<': |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -27,6 +28,9 @@ | |||
from verify_included_modules import get_public_modules | |||
|
|||
|
|||
docstring_test_parser = doctest.DocTestParser() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM FWIW |
example_str += '%s' % (example.source,) | ||
example_str += '%s' % (example.want,) | ||
|
||
return example_str.replace('<', '<').replace('>', '>') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Pull examples with doctest and exit less early for Method parsing. Move example docstring from connection.py->client.py Change clas to klass.
588f301
to
ac356df
Compare
LGTM. @daspecster on future PRs can you hold off on squashing until the PR is ready to merge? It makes it a lot harder to verify which fixes have been made during code review. |
@dhermes ah ok good point! Thanks! |
@tseaver I missed your |
@daspecster Nope, I was mistaken: |
Yup. |
Fixes #2037.
This is a partial fix for the datastore docstring issue.
The original issue was actually, in part, due to the examples being in the datastore.Connection class. Sphinx put them all on one page for some reason.