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

Request: Compact annotations #1306

Closed
AndydeCleyre opened this issue Jan 20, 2021 · 16 comments · Fixed by #1477
Closed

Request: Compact annotations #1306

AndydeCleyre opened this issue Jan 20, 2021 · 16 comments · Fixed by #1477
Labels
cli Related to command line interface things feature Request for a new feature

Comments

@AndydeCleyre
Copy link
Contributor

AndydeCleyre commented Jan 20, 2021

What's the problem this feature will solve?

Primary:

I would like to see a lot more information on my screen without having scroll up and down, when viewing annotated pip-compile output. At least as much as was the case before annotations became split into many lines.

Secondary:

I would like to use simple line-oriented shell tools to casually inspect properties of the pip-compile output, without resorting to multi-line regular expressions.

Describe the solution you'd like

I would like the ability, through a flag or any other means, to have pip-compile's annotated output place annotations for a pinned requirement on the same line as said requirement.

My screen is wide and short, as is common for computers. It's a more efficient use of this space to use more width and less height.

Example of the different use of space, for the magic-wormhole package from PyPI:

Example

Alternative Solutions

  • I could skip annotations, but then I'd lose a lot of valuable information.
  • I could add a post-processor to re-write the pip-compile output every time I compile.
  • I could revert Improve formatting of long "via" annotations #1237 and poorly maintain a fork of this project, but that would make me sad.

Additional context

@atugushev
Copy link
Member

Based on feedback it looks like we should have introduced one-per-line annotations via an option. Well, better to do it late than never. I don't mind adding an option for the old-style annotations.

@ulope
Copy link
Member

ulope commented Jan 28, 2021

Just to give some feedback in the other direction: I'm very happy with the new separate line mode. The old format often caused really annoying merge conflicts that more than once lead developers in our team to just "blow away" the generated requirements.txt and compile a new one (with the obvious drawbacks of uncontrolled version changes)...

@AndydeCleyre
Copy link
Contributor Author

@jdufresne

Would you like to tackle this one?

@jdufresne
Copy link
Member

As this is an issue for enough users, please go ahead with adding an option. While I will personally not use it, clearly enough people will so might as well try to make this useful for as many people as possible.

@cjerdonek
Copy link

It occurs to me that this, as well as a number of other issues in pip-tools's tracker that want to alter and customize pip-tools's output in various ways, could perhaps be enabled generally if pip-compile provided the option of outputting the information it has in a structured format like json. Then it would be a lot easier for people to create requirements.txt files in the format (and content) they want if not explicitly supported by pip-compile. Currently, trying to alter pip-compile's output by parsing is fragile because the output format can change from release to release.

@pohmelie
Copy link

@cjerdonek
If I got you right, then I disagree. I think --format with some argument is classic solution and enough for this case.

@ushuz
Copy link

ushuz commented Mar 19, 2021

I think #1297 (comment) is the way to go, future proof.

@cjerdonek
Copy link

It occurs to me that this, as well as a number of other issues in pip-tools's tracker that want to alter and customize pip-tools's output in various ways, could perhaps be enabled generally if pip-compile provided the option of outputting the information it has in a structured format like json.

FYI, I just created issue #1377 expanding on my suggestion above.

If I got you right, then I disagree. I think --format with some argument is classic solution and enough for this case.

@pohmelie I don't disagree with you. pip-tools can still implement feature requests like this. I was merely pointing out a way that pip-tools could make it easier for users to work-around issues in cases where pip-tools hasn't yet implemented the feature in pip-tools itself.

@pohmelie
Copy link

pohmelie commented Apr 7, 2021

@cjerdonek, that sounds nice.

@merwok
Copy link

merwok commented Apr 9, 2021

JSON output seems potentially useful but orthogonal to the issue at hand, which is about a simple option to restore previous output format. It’s been a few months, people are either stuck with older pip-tools and can’t accept dependabot PRs anymore, or have to accept a PR with 100% diff. As time passes and newer pip gets incompatible with older pip-tools, this won’t be tenable.

@BarnabasSzabolcs
Copy link

BarnabasSzabolcs commented Apr 23, 2021

The last pip-tools version that generates compact requirements.txt annotations is 5.4.0. I stick to using that.

@atugushev atugushev added cli Related to command line interface things feature Request for a new feature labels Jul 17, 2021
@AndydeCleyre
Copy link
Contributor Author

@jdufresne

Could you please at least weigh in on some of the proposed fixes? These include a structured output option, and two specific format options. I am guessing you would not support making the old style the default. I want to reduce wasted/undone work by getting input from the new-style "camp" written out here.

@jdufresne
Copy link
Member

@AndydeCleyre sorry for the late response.

I like @cjerdonek's idea of adding a structured intermediate format that can then be manipulated further (outlined in #1377). pip-tools could ship with two formatters one with the multi-line annotations and one with the compact annotations. The project could choose one or the other as the default output. I personally like the multi-line as the default, but recognize others may prefer the compact.

I won't have the time to implement this, so it would be a welcome contribution from other maintainers or contributors. Thanks all for the feedback.

@AndydeCleyre

This comment has been minimized.

@AndydeCleyre
Copy link
Contributor Author

I invite all interested parties to provide feedback for #1477, which adds --annotation-style.

@atugushev
Copy link
Member

Old annotation style is released in pip-tools v6.3.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to command line interface things feature Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants