| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| if element.docstring: | ||
| if not isinstance(element, pdoc.Class) and element.cls: | ||
| cls = element.cls.cls | ||
| clas = element.cls.cls |
We have until now curated all the docs/*.rst files to make the documentation usable, so just machine generating from every module with no regard for the original hand curated docs is a bad idea. |
Sorry, something went wrong.
|
I agree with you there. That's probably a bigger topic than this PR though. |
Sorry, something went wrong.
|
Slowly bringing the two approaches in sync would've been the right move. There is a way (one that is employed by oauth2client) to just have the files themselves be the source of truth. |
Sorry, something went wrong.
|
I'm not really following I guess. sphinx-apidoc --separate --force -o docs/source oauth2client 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. |
Sorry, something went wrong.
|
The point is that in that regime we don't care what is in the RST files. Using sphinx-apidoc makes the Python modules the single source of truth. |
Sorry, something went wrong.
|
Basically instead of get_public_modules? |
Sorry, something went wrong.
|
I'm not referring to your handrolled solution, so get_public_modules is kind of a side-concern. I'm just saying if we went that route then it would easier map onto the concept that you've come up with (which I think was to map onto whatever has been done in gcloud-common) |
Sorry, something went wrong.
|
The gcloud-common site structure is different from our sphinx structure. I asked for multiple class support but didn't gain any traction. That would help match things up to what we have in Sphinx. In anycase, I moved the example code to client.py since that's in the top level nav for the site docs. We should probably think of a strategy for handling this stuff though. |
Sorry, something went wrong.
|
That sounds fine, we should have an issue for this discussion. Your docstring changes seem fine, how should I vet the docgen stuff in scripts/generate_json_docs.py? |
Sorry, something went wrong.
|
Sure, although generate_json_docs.py is not great code and should be refactored and cleaned up. I made #2043 to talk about what I think you were saying before. |
Sorry, something went wrong.
|
Thanks |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
| # Hack for old-style classes | ||
| if str(cls)[0] != '<': | ||
| cls = '<class \'' + str(cls) + '\'>' | ||
| if str(klass)[0] != '<': |
| from verify_included_modules import get_public_modules | ||
|
|
||
|
|
||
| docstring_test_parser = doctest.DocTestParser() |
|
LGTM FWIW |
Sorry, something went wrong.
| example_str += '%s' % (example.source,) | ||
| example_str += '%s' % (example.want,) | ||
|
|
||
| return example_str.replace('<', '<').replace('>', '>') |
Pull examples with doctest and exit less early for Method parsing. Move example docstring from connection.py->client.py Change clas to klass.
|
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. |
Sorry, something went wrong.
|
@dhermes ah ok good point! Thanks! |
Sorry, something went wrong.
|
@tseaver I missed your use the six wrappers comment until after merge. But I changed that line to cgi.escape() anyway. Were you saying there is a six wrapper for cgi.escape? I didn't see anything like that in six. |
Sorry, something went wrong.
|
@daspecster Nope, I was mistaken: six does not have the wrapper. |
Sorry, something went wrong.
|
Yup. six does have urllib though (if we did go the urlencode route) |
Sorry, something went wrong.
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Adds a function `determine_requested_streams()` to compare `preserve_order` and the new argument `max_stream_count` to determine how many streams to request.
```
preserve_order (bool): Whether to preserve the order of streams. If True,
this limits the number of streams to one (more than one cannot guarantee order).
max_stream_count (Union[int, None]]): The maximum number of streams
allowed. Must be a non-negative number or None, where None indicates
the value is unset. If `max_stream_count` is set, it overrides
`preserve_order`.
```
Fixes #2030 🦕
| Back | FazBrowse Home | New Git URL |
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.