-
Notifications
You must be signed in to change notification settings - Fork 3k
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
FEAT: The PIP command alias feature #12828
base: main
Are you sure you want to change the base?
Conversation
everything ready to be merged, could anyone review it to do the merge? |
Also, for the future, please don't mention maintainers for a first review -- we tend to have a lot of notifications already and, in my case, this didn't really affect if/when I see this PR. |
Now the aliases are displayed with pip --help just as you suggested in #8130 Also from now on each command has the right to as many aliases as it wants
Update: Even though I don't agree, I added checks when there are typos, if you change your mind just ignore the commit 55585e2As for the fix suggestions, I haven't implemented them yet, do you think something like this is really worth it? since it's not the actual command but just the nickname? In my opinion, corrections should only be reserved for exact command names because in addition to adding additional complexities, it can cause confusion about the real name of the command, for example if it is accidentally typed "in" it will probably point to "i" and not "install", this can cause confusion for those using it |
When will this get a real review? I know I may appear to be in a hurry, but it turns out that the pip code is constantly changing and a PR can become obsolete in a short time... |
While personally I agree with this sentiment (I would be -0 on this idea), I think it's best to discuss this design choice in #8130 and have this discussion for PR implementation review. |
Is there a chance this will be merged someday? Can someone please review it? |
Given the many differing viewpoints shared in the original issue, there is absolutely no guarantee that this will be merged, but I will try to take a look in the next week. |
In many package managers there are abbreviations for certain commands that are too long to write and are written repeatedly. an example of this is npm where
npm install
can be abbreviated asnpm i
, and everything will work normally.This makes development more efficient and was something pip was missing
My PR brings this functionality in a clear and scalable way, now it is possible to abbreviate commands
pip install
can be used aspip i
orpip add
pip list
can be used aspip ls
pip uninstall
can be used aspip un
orpip rm
Risk assessment
Low.
Abbreviations are not new commands and do not replace existing commands. Only when a command is not recognized is it checked whether the unrecognized command is an abbreviation of a command. Ex (i -> install) if it is, it is understood as the command but if not, the flow continues normally
Before:
After:
everything is scalable and in the future more abbreviations can be made just by putting the name of the command and the abbreviation and a dict
More screenshots