Skip to content
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

Add helpful error message for incorrect PyPI URL #509

Merged
merged 14 commits into from
Oct 30, 2019

Conversation

adityasaky
Copy link
Contributor

Closes #499.

Signed-off-by: Aditya Saky <aditya@saky.in>
@codecov

This comment has been minimized.

Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I've asked for some changes to make the message more accurate, plus a couple stylistic things.

Also, since this is new conditional behavior, it'd be nice to have a test for it. Unfortunately, we don't have an existing test of check_status_code. Even though this code is in twine.utils, I'd be inclined to test it in test_upload.py, since this is upload-specific code. That makes me wonder if check_status_code should be moved to commands/upload.py, similar to skip_upload.

Are you game to continue working on this?

Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky
Copy link
Contributor Author

adityasaky commented Oct 7, 2019

Thanks for the quick review!

... since this is new conditional behavior, it'd be nice to have a test for it. Unfortunately, we don't have an existing test of check_status_code. Even though this code is in twine.utils, I'd be inclined to test it in test_upload.py, since this is upload-specific code. That makes me wonder if check_status_code should be moved to commands/upload.py, similar to skip_upload. Are you game to continue working on this?

Yep, I looked to see where check_status_code was tested and didn't see any. I'd be happy to move it to upload.py and add tests for it, though progress may be a bit slow on that front since the week just started.

Edit: I should probably also update this docstring:

def check_status_code(response, verbose):
    """
    Shouldn't happen, thanks to the UploadToDeprecatedPyPIDetected
    exception, but this is in case that breaks and it does.
    """

@adityasaky adityasaky force-pushed the enh-499-update-error-message branch from e7a3976 to ec53ae8 Compare October 7, 2019 23:23
Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky
Copy link
Contributor Author

@bhrutledge let me know if this looks okay and if I need to add more tests. :)

@adityasaky adityasaky requested a review from bhrutledge October 7, 2019 23:27
Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround! Looking good. I've got a few requests, plus some additional opportunities for testing. If you're game to continue working on it, we'd appreciate it, but we could also finish it up.

… test name and override comment

Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky adityasaky force-pushed the enh-499-update-error-message branch 2 times, most recently from 445c092 to d2cc71d Compare October 8, 2019 01:11
…repository URLs

Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky
Copy link
Contributor Author

@bhrutledge I think I've mostly resolved your suggestions. Let me know about the additional test for deprecated PyPI repository URLs. :)

@adityasaky adityasaky requested a review from bhrutledge October 9, 2019 14:25
@bhrutledge
Copy link
Contributor

Thanks for continuing to work on this @adityasaky, and thanks for the ping. It might be the weekend before I can review it, but I'm hoping to get to it sooner.

@adityasaky
Copy link
Contributor Author

No worries, thanks for the update! :)

Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky
Copy link
Contributor Author

@bhrutledge Sorry for the delay, let me know if this checks all the boxes. :)

Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for continuing to work on this, and bearing with my pedantic feedback. I think this is sufficient, and an improvement, so I'm wary of asking you to keep going. You're welcome to, but I'm also happy to make my suggested changes (which are admittedly a bit vague).

@adityasaky adityasaky force-pushed the enh-499-update-error-message branch from bc89769 to 1a9d5e0 Compare October 13, 2019 16:23
Signed-off-by: Aditya Saky <aditya@saky.in>
Signed-off-by: Aditya Saky <aditya@saky.in>
@bhrutledge bhrutledge requested a review from di October 13, 2019 19:10
@bhrutledge bhrutledge changed the title ENH: Add helpful error message for incorrect PyPI URL Add helpful error message for incorrect PyPI URL Oct 13, 2019
@bhrutledge bhrutledge removed the request for review from jaraco October 20, 2019 12:47
Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sigmavirus24 Thanks for the feedback. At the risk of hijacking this PR with maintainer-level discussion, I've asked a few questions.

@adityasaky Thanks for your patience. If you're game to make the requested style changes, awesome. Otherwise, I'm happy to do it, if you grant us permission to make changes to your branch.

@adityasaky
Copy link
Contributor Author

Thanks for the feedback @bhrutledge, @sigmavirus24! I aim to work on the requested changes later this week / early next week. I hope that's okay.

@bhrutledge
Copy link
Contributor

@adityasaky Of course! Thanks again. Let us know if you have any questions.

Signed-off-by: Aditya Saky <aditya@saky.in>
Signed-off-by: Aditya Saky <aditya@saky.in>
Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky
Copy link
Contributor Author

Apologies for the lateness. I believe I've addressed everything except potentially moving check_status_code back to utils. Please let me know if things look okay!

Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adityasaky Thanks for coming back to this! Hopefully just a few more quick changes.

Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky adityasaky force-pushed the enh-499-update-error-message branch from 4a51553 to 360eb5a Compare October 28, 2019 13:34
Signed-off-by: Aditya Saky <aditya@saky.in>
@adityasaky
Copy link
Contributor Author

I think that's everything, @bhrutledge?

Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for sticking with this. Looks good to me, and the diff is definitely easier to read.

@sigmavirus24 What do you think?

@jaraco jaraco merged commit 109bddc into pypa:master Oct 30, 2019
@jaraco
Copy link
Member

jaraco commented Oct 30, 2019

Thanks everybody for the diligent work on this change that's sure to improve the user experience.

@bhrutledge bhrutledge mentioned this pull request Apr 15, 2020
5 tasks
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.

Helpful error message when failing to upload to an inaccurate PyPI URL
5 participants