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

Improve the check command output #488

Merged
merged 12 commits into from
Sep 17, 2019
Merged

Improve the check command output #488

merged 12 commits into from
Sep 17, 2019

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Aug 25, 2019

Old:

Screenshot 2019-08-25 at 11 55 25 AM

Screenshot 2019-08-25 at 11 55 06 AM

New:

Screenshot 2019-08-25 at 11 54 21 AM

Screenshot 2019-08-25 at 11 54 39 AM

I think that's an improvement. :)


44ff389 prints a message, when there are no distributions given to check.

136de41 fixes a bug, where the errors in a distribution's markup, would flow through to the next distribution's errors. This was because they used the same stream.

Let me know if anyone prefers that I break these two out into separate PRs.


I can add colours to "FAILED", "PASSED" and "PASSED, with warnings" in a follow up PR, y'all are cool with it. I didn't in this PR, since I don't know if the maintainers are OK with another dependency. :)


I suggest reviewing this commit-by-commit. :)

@codecov
Copy link

codecov bot commented Aug 25, 2019

Codecov Report

Merging #488 into master will increase coverage by 0.29%.
The diff coverage is 97.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #488      +/-   ##
==========================================
+ Coverage   84.62%   84.91%   +0.29%     
==========================================
  Files          14       14              
  Lines         787      809      +22     
  Branches      115      121       +6     
==========================================
+ Hits          666      687      +21     
  Misses         85       85              
- Partials       36       37       +1
Impacted Files Coverage Δ
twine/commands/check.py 98.64% <97.56%> (-1.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 182e8af...06e8380. Read the comment docs.

@codecov
Copy link

codecov bot commented Aug 25, 2019

Codecov Report

Merging #488 into master will increase coverage by 0.29%.
The diff coverage is 97.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #488      +/-   ##
==========================================
+ Coverage   84.62%   84.91%   +0.29%     
==========================================
  Files          14       14              
  Lines         787      809      +22     
  Branches      115      121       +6     
==========================================
+ Hits          666      687      +21     
  Misses         85       85              
- Partials       36       37       +1
Impacted Files Coverage Δ
twine/commands/check.py 98.64% <97.56%> (-1.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 182e8af...a07d35f. Read the comment docs.

@pradyunsg
Copy link
Member Author

Omigod. CI that gives a result in 1 minute, not 1 hour. :o

I need this more often in my life.

Copy link
Member

@sigmavirus24 sigmavirus24 left a comment

Choose a reason for hiding this comment

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

See the in-line comments. Also, I wonder if there are docs that need to be updated to explain the nuance between PASSED and PASSED, with warnings. Since not everyone using twine speaks English (or understands it as a first language)

@sigmavirus24
Copy link
Member

I'm also a bit worried - given that the textual output is really our primary API for most people - that changing the formatting is going to break things.

@sigmavirus24
Copy link
Member

I can add colours to "FAILED", "PASSED" and "PASSED, with warnings" in a follow up PR, y'all are cool with it

That would require automatic detection to disable colours when the output stream is not a TTY. Alternatively, I think we'd need to add configurable options for disabling that. And as soon as we start giving people this kind of configuration, I worry that people will want to eventually work on their own colourschemes or something equally far-fetched. I'll leave decisions about that to @di and @jaraco

@pradyunsg
Copy link
Member Author

pradyunsg commented Aug 25, 2019

I'm also a bit worried - given that the textual output is really our primary API for most people - that changing the formatting is going to break things.

Uh... the current output doesn't have much (any?) structure to it? "warning: " shows up in the same line as the Passed/Failed are supposed to be (based on what happens when there are no warnings), which pushes Passed or Failed to a new line. The same stream is used for rendering multiple READMEs, resulting in duplicated errors in later distributions -- assuming they have the same READMEs.

Further, the output isn't documented anywhere as "will not change".

I wonder if there are docs that need to be updated to explain the nuance between PASSED and PASSED, with warnings

Well, there aren't too many docs for twine check in the first place. It's only mentioned once in the README, and that too without output. :)

I'm not super stoked about requiring new documentation as a part of this PR -- we can tackle improving twine check documentation in a follow up.

reg: colours in CLI

I know I brought it up -- I also don't want that to mix-up in the discussion of output changes.

Let's discuss this elsewhere, perhaps in a new issue?

@sigmavirus24
Copy link
Member

Uh... the current output doesn't have much (any?) structure to it?

But it's consistent in its (crappy) behaviour, right? Thus there's implicit structure

Further, the output isn't documented anywhere as "will not change".

Regardless of whether it's documented as "will not change" people build tooling and automation around it. It's not an unfair assumption.

I'm not super stoked about requiring new documentation as a part of this PR

Documentation is critical to the maintainability of the project. Given there isn't much documentation that exists, is it really that opprobrious to ask for documentation as part of this pull request?

Let's discuss this elsewhere, perhaps in a new issue?

Yeah, I'm happy to discuss things in other places.

@pradyunsg
Copy link
Member Author

But it's consistent in its (crappy) behaviour, right? Thus there's implicit structure

Okay, I'm confused.

Are you suggesting that twine should maintain it's current "crappy" behavior because someone might be parsing this output?

If so, that's fine. I can live with with that.

I felt like this change is an improvement for literally everyone else, and for folks are parsing this output, they'd likely appreciate intentional structure in the output; even if it breaks things for them right now.

Documentation is critical to the maintainability of the project.

I strongly agree. I've tackled things like pypa/pip#5526 precisely because they make life easier for maintainers, like us. :)

Given there isn't much documentation that exists, is it really that opprobrious to ask for documentation as part of this pull request?

I wouldn't call it opprobrious but, yes, it's unfair to hold this PR to a higher standard than status quo, for a thing it's not directly intended to improve/affect.

Additionally, I prefer PRs be scoped to do single tasks, so that an independently improvable thing doesn't block them. To be abundantly clear, I'm not opposed to improving twine check's documentation. I just don't want that to block this change, which I do view as an independent improvement.


I'm sorry, but the discussion is getting meta and I genuinely don't have the mental bandwidth to try to push through a meta discussion for this.

I'm happy to let this PR sit open, until y'all figure stuff out -- lemme know if there's any code changes/output formatting changes desired here. Or... if y'all decide that the current output is good enough.

@pradyunsg
Copy link
Member Author

Poking this again to see if any @pypa/twine-maintainers have inputs here.

I'd really like to see this get improved since the current output isn't very nice.

@bhrutledge bhrutledge mentioned this pull request Sep 7, 2019
@bhrutledge
Copy link
Contributor

@pradyunsg Thanks for the nudge, and your patience. I like the new output, but think it still needs buy-in from other maintainers. To potentially mitigate the backwards-compatibility concern, I've proposed releasing it as part of Twine 2.0.

@pradyunsg
Copy link
Member Author

pradyunsg commented Sep 9, 2019

Thanks @bhrutledge!

I strongly warn against viewing this as a backward incompatible change, since it sets a precedence for not being able to change twine's output at all, even for significant improvements to "crappy" output (or for bug fixes? idk where @sigmavirus24 is drawing the line). IMO that's not a good spot to be in but that's something for the maintainers to decide upon.

Anyway, since I won't be dealing with the consequences of that decision, I'm on board for that if viewing this as a backward incompatible change means that we roll it out quicker. Especially, if it's before I get frustrated enough to drop this, given how my experience contributing here has been.


To reiterate my thoughts on this, literally all users of twine check would benefit from this change, in the short term or, if they're doing something that's not explicitly mentioned as OK to do, in the medium term.

Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

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

I'm in favor of this and don't see it as a breaking change. I've never seen anyone relying on the output from twine check and even if they are, I don't think that we should imply that this is a valid API here (aside from the exit code).

@bhrutledge bhrutledge self-requested a review September 17, 2019 10:20
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 the improvement. I added two small, non-blocking style questions.

tests/test_check.py Show resolved Hide resolved
twine/commands/check.py Outdated Show resolved Hide resolved
@jaraco jaraco dismissed sigmavirus24’s stale review September 17, 2019 10:49

I believe the concerns were addressed.

Copy link
Member Author

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

Self-reviewed, so that I can commit suggested changes while using the GitHub's UI.

twine/commands/check.py Outdated Show resolved Hide resolved
twine/commands/check.py Outdated Show resolved Hide resolved
@jaraco jaraco merged commit 47f8477 into pypa:master Sep 17, 2019
@pradyunsg pradyunsg deleted the better-check-command branch September 17, 2019 15:35
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.

5 participants