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

Flag for 'pip index versions' to output only latest version #10985

Closed
wants to merge 2 commits into from
Closed

Flag for 'pip index versions' to output only latest version #10985

wants to merge 2 commits into from

Conversation

YarivFishman1
Copy link

Description

This flag prints the latest available version of package in a pypi index.

I used pip index versions command to obtain the latest version of a package.
The problem is that I had to parse the command and wanted a simple solution like this flag.

The purpose of this flag is to print the latest available
version of a given package.
@uranusjr
Copy link
Member

I think instead of adding a flag for one particular use case, we should use this chance to go through a proper UI design the output and flags.

@YarivFishman1
Copy link
Author

I think instead of adding a flag for one particular use case, we should use this chance to go through a proper UI design the output and flags.

Like a --format flag which can print the output as json?

Also move the formatting logic outside of `with` statement.
@uranusjr uranusjr changed the title src: commands: index: Add --latest flag Flag to output 'pip index versions' in machine-readable format Apr 9, 2022
uranusjr
uranusjr previously approved these changes Apr 9, 2022
@uranusjr uranusjr dismissed their stale review April 9, 2022 13:11

misclick

Comment on lines +38 to +44
self.cmd_opts.add_option(
"--latest",
dest="latest",
action="store_true",
default=False,
help="Print only the latest version of the given package.",
)
Copy link
Member

Choose a reason for hiding this comment

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

If we drop this on for now I think this can go in. But the show only latest logic would need much more discussion.

@uranusjr uranusjr changed the title Flag to output 'pip index versions' in machine-readable format Flag for 'pip index versions' to output only latest version Apr 9, 2022
@YarivFishman1 YarivFishman1 closed this by deleting the head repository Nov 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants