-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Adding MusicBrainz OAuth2 support #2298
Conversation
Hi, @tigranl! This is a great start! There are a few errors here, though—have you tried running the code to see if it works? For example, the exception names like TokenRequestDenied seem to be undefined. These problems look fairly straightforward to fix, at which point we can call the task done. I'm going to add extra time for this task on the GCI site, once I can get it to load (it's moving quite slowly today)… You can also check out the Travis link above to see our automatic code checker's findings on your code. That can help with both style and correctness. |
@@ -28,8 +28,6 @@ | |||
|
|||
SUBMISSION_CHUNK_SIZE = 200 | |||
UUID_REGEX = r'^[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}$' | |||
AUTH_ERRORS = (TokenRequestDenied, TokenMissing, VerifierMissing) | |||
|
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.
The right thing to do here is probably to import these exception names so we can use them, like this: https://github.com/beetbox/beets/blob/master/beetsplug/beatport.py#L26-L27
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.
I thought about it, but I am using rauth lib and these are from requests_oauthlib.
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.
Ah, of course; that makes sense. So perhaps it would make sense to use the exceptions from rauth
instead, or to switch to requests_oauthlib
if it's not too different?
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.
I was searching for rauth
description of exception names, but with no luck. The project's documentation isn't very good. Probably gonna switch to requests_oauthlib
.
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.
That sounds great! Sorry for pointing you at the wrong library initially.
Did I forget to set up some initial settings for plugin scripts? |
Ah, yes; the (As a quick logical check: where would those arguments come from?) Instead, you might want to move the code for the OAuth dance to its own method. Then, the |
This comment has been minimized.
This comment has been minimized.
What's the problem with Travis check? 🤔 |
Cool; thanks for updating this! You can click on the Travis result to see more details. In particular, our style checker has suggestions for you: https://travis-ci.org/beetbox/beets/jobs/181104004#L848 For example, there are a few PEP8 style issues to be corrected. (See the coding conventions on the wiki.) Most of them have to do with indentation—PEP8 mandates four-space indentation—and long lines. If you like, you can run these checks locally too! Just use |
Yeah, I know about PEP8, sometimes I just forget about it. I checked last commit on my computer using flake8, as you suggested, and it executed without errors. But still can't get the same from Travis. |
As usual, it's a good idea to look at the Travis log for the information you need: https://travis-ci.org/beetbox/beets/jobs/181339627#L852 |
Oh, missed the second blank line. Sorry, will be more attentive next time! |
Awesome; thanks! I think we can call the GCI task done if you'd like to submit. And, if you're interested in taking this one step further, we can look into how to actually use the OAuth credentials to make the requests that this plugin needs to make. This might involve crafting our own API requests instead of going though python-musicbrainzngs. Or we could make progress on alastair/python-musicbrainzngs#199 on the way to resolving alastair/python-musicbrainzngs#89. |
Can we come back to this task on weekend? Now I would like to do some other tasks for Beets or MusicBrainz. Do you have some in mind? |
Of course! I don't have any particular preference for any task over any other, but maybe one of these two would be a good fit? |
So is this able to be merged as-is? |
It looks more or less complete to me, although I have not tried to actually run the code. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
No description provided.