-
Notifications
You must be signed in to change notification settings - Fork 714
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
Update docstrings/pydoc/help (#170) #438
Conversation
Add pydoc for package. I don't want to duplicate the REAME here, so directing users to it instead. HTTPS doesn't get highlighted for some reason, so HTTP link used.
Some copied from config.yml.
These are sphinx style, but it takes up a lot of space.
Still a few to go.
Apparently Sphinx can do list(type) or list[type]. If we ever use it this'll make things more clear.
Add docstrings for methods, properties. Typo fix in Mail.send_at
Whew, almost done.
These don't really add anything over the class docstrings, but they're also the thing that most people will look at.
Can't use these in Python 2 because we haven't declared an encoding. Oops.
Codecov Report
@@ Coverage Diff @@
## master #438 +/- ##
==========================================
- Coverage 83% 82.92% -0.09%
==========================================
Files 30 30
Lines 1024 1025 +1
Branches 160 161 +1
==========================================
Hits 850 850
- Misses 84 85 +1
Partials 90 90
Continue to review full report at Codecov.
|
You, sir, are an animal. |
print(response.headers) | ||
print(response.body) | ||
|
||
if __name__ == '__main__': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a doc string! Looks like this snuck in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, forgot to document that. pydoc
imports files to get their docstrings, so the unconditional code there executes and causes an error since it isn't in the right context. I added an escape so that it just imports and doesn't attempt to do anything unless it's being run directly or from the command line.
Shuffle docs around to fit the new Mail helper structure. Hopefully I didn't miss anything; due to the amount of code getting moved around. I'll check the diff against master and then revert if needed.
Put TrackingSettings in the right place.
I think we can configure the docstring problem at codeclimate, it is running on an extremely simplified config - https://github.com/sendgrid/sendgrid-python/blob/master/.codeclimate.yml This can be updated, but I didn't look into it yet. |
I am not sure if this is related to this PR, but I am getting an error in Travis after it runs tests:
|
I made an issue (#483) for the Code Climate thing (not a big deal IMO, maybe a good last-minute Hacktoberfest) and will look at the Travis stuff. |
I hate moving around big chunks of code like this; I wish git was more intelligent moving things between files.
@gabrielkrell let me know when you're g2g on this one :) |
@mbernier I think we're all set. Excited to see this in master. |
Hello @gabrielkrell, |
Add docstrings in main package, helpers. Now things will show up nicely when people show documentation in their editor, use
help
, or use pydoc to browse the documentation in HTML form.Downside: much of the Mail helper docs are copied from the v3 docs, which isn't great for maintainability. I think it'd be too unapproachable just to say "read the docs", and linking docs updates to these docstrings would be a lot of work for the rewards. Maybe a future automation candidate though :)
Example output:
Pop-up docs in editors:
pydoc
HTML:Package-level
help
:And individual classes: