Skip to content

Thoughts on supporting git-style subcommands? #2690

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

Closed
beaugunderson opened this issue Apr 15, 2015 · 4 comments
Closed

Thoughts on supporting git-style subcommands? #2690

beaugunderson opened this issue Apr 15, 2015 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@beaugunderson
Copy link

I've been thinking about ways to make releasing packages easier lately and one thought was to add a pip init command for generating a setup.py file--but someone beat me to it!

git solves integrations like these by including subcommands: it will search $PATH for executable files beginning with git-; so you can throw an executable file named git-rank into your $PATH and run git rank (no dash) to run the command.

I'm looking for feedback on whether a patch to pip that adds git-style subcommands would be welcome or not (because then one could type pip init instead of pip-init, without modifying pip itself).

@pfmoore
Copy link
Member

pfmoore commented Apr 16, 2015

See #2329 and #1409 for prior discussions on this idea.

@rbtcollins
Copy link

FWIW I'm mildly against this. Older pip doesn't offer this, so anyone offering a broadly compatible extension like pip-init will probably have a standalone command... and document using it like that.

@dstufft
Copy link
Member

dstufft commented Apr 17, 2015

I tried git style subcommands on twine and it turned out that it caused problems for twine (pypa/twine#74, pypa/twine#32) when not run from the $PATH. You can possibly work around it by dynamically adjusting the $PATH to always include the directory of the pip command but that's kind of hackish.

Another problem is that pip is installed by default into every virtual environment, so you'll end up with things like pip init where pip is from a virtual environment but the pip-init command is from the global environment. For the pip-init command this probably isn't a very big deal, but it could be a big deal for other kinds of commands like it.

Ultimately unless pip provides an API the only real difference is that you'd be able to type pip init instead of pip-init and I'm not sure that it really makes sense to add this machinery so you can type a slightly difference character sometimes.

I'm going to go ahead and close this.

@dstufft dstufft closed this as completed Apr 17, 2015
@beaugunderson
Copy link
Author

Thanks for the quick responses and sorry I missed the earlier issues! (I looked but used sub-optimal search terms) :)

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

4 participants