8000 Consistency is a hobgoblin of a small mind by sigmavirus24 · Pull Request #773 · sigmavirus24/github3.py · GitHub
[go: up one dir, main page]

Skip to content

Consistency is a hobgoblin of a small mind #773

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

Merged
merged 59 commits into from
Mar 12, 2018

Conversation

sigmavirus24
Copy link
Owner

This pull request unifies the way objects work in github3.py. We use direct access of the keys in the dictionary instead of calling .get() this will provide a more consistent interface and set of expectations for users.

This also introduces consistency in the orgs module in how we set-up
attributes for the *Team and *Organization classes. It also rewrites the
docstrings to be consistent with the rest of the library
@omgjlk
Copy link
Collaborator
omgjlk commented Feb 12, 2018

How goes things here? Anything I could help with?

This splits up the different representations of licenses across the
GitHub API for acccuracy.
@sigmavirus24
Copy link
Owner Author

How goes things here? Anything I could help with?

Sorry, I missed this entirely.

One of the things I'd like to be able to do is completely get rid of the _*_attribute methods by eliminating their usage in the modules. If you want to tackle some of the submodules I haven't made my way to yet (I'm working backwards alphabetically and ignoring issues, gists, search, and repos for now). That would be awesome. Keep an eye out as you do this for any objects that need further splitting up. I've found several already.

@omgjlk
Copy link
Collaborator
omgjlk commented Feb 14, 2018

Okay, I'll take a look through.

Removes the use of _get_attribute and its ilk.

Related-to: #773
This also created a CommitTree object as the tree is different via the
git object API vs the repository object API. New example data is added
to account for this difference as well.
Merging omgjlk's branch into consistency-is-a-hobgoblin
Let's try to mainly import modules instead of functions or members.
Let's update the class documentation and add otherwise missing
attributes.
Add better documentation around the objects there and what they
represent. Also add a new Commit-like object for RepoCommits
@omgjlk
Copy link
Collaborator
omgjlk commented Feb 19, 2018

It looks like github3/model.py is the last module that has calls to _get_attribute and the like, outside of issues, gists, search, and repos. Digging into model.py would break things inside of those, so some strategy is necessary there I think.

This adds the ShortComment class to represent comments without text and
html bodies. This also removes the BaseAccount, BaseComment, and
BaseCommit classes as they're no longer used or necessary.
@sigmavirus24
Copy link
Owner Author
sigmavirus24 commented Mar 5, 2018

Remaining modules to update:

  • repos.hook
  • repos.issue_import
  • repos.pages
  • repos.release
  • repos.repo
  • repos.stats
  • repos.status
  • repos.tags
  • github
  • models

If folks want to help out, send PRs to this branch.

@sigmavirus24 sigmavirus24 force-pushed the consistency-is-a-hobgoblin branch from 1e044d4 to 57bbe14 Compare March 9, 2018 22:55
GitHub is inconsistent in the timestamps it returns for the issue import
API. strptime has a way of handling UTC offsets a format like -0600 but
not -06:00. There's no good way to handle that with the standard
library, so here we must add dateutil.
@sigmavirus24 sigmavirus24 force-pushed the consistency-is-a-hobgoblin branch from 57bbe14 to b273037 Compare March 9, 2018 23:22
@sigmavirus24 sigmavirus24 force-pushed the consistency-is-a-hobgoblin branch from 6fce842 to 7f32e37 Compare March 10, 2018 23:36
@sigmavirus24 sigmavirus24 force-pushed the consistency-is-a-hobgoblin branch from cbbf492 to b1972fc Compare March 11, 2018 18:03
@sigmavirus24 sigmavirus24 force-pushed the consistency-is-a-hobgoblin branch from b1972fc to 5814c53 Compare March 11, 2018 18:31
@sigmavirus24 sigmavirus24 changed the title WIP: Consistency is a hobgoblin of a small mind Consistency is a hobgoblin of a small mind Mar 11, 2018
@sigmavirus24 sigmavirus24 merged commit 508efde into develop Mar 12, 2018
@sigmavirus24 sigmavirus24 deleted the consistency-is-a-hobgoblin branch March 12, 2018 00:15
@mindw
Copy link
Contributor
mindw commented May 20, 2018

Better late than never - only 1.5 years. Finally I can stop using my ancient fork for correct timestamp parsing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0