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

Scripted input for ask() invocations #351

Closed
wants to merge 2 commits into from

Conversation

charles-dyfis-net
Copy link

When driving pip from another script, one occasionally needs to be able to provide feedback for interactive prompts which may come up. This patch provides a way to do that.

Environment variables matching the form PIP_INPUT_* are treated as holding
prompts, to which environment variables named as PIP_ACTION_* hold the
responses.

This allows sophisticated pattern/response matching when pip is called by an
external tool.
@hltbra
Copy link
Contributor

hltbra commented Sep 15, 2011

I would like to see a use case and some tests for this feature and just to note it would not work as is because of iteritems (use items because of Python 3).

Don't know what people would think about this canned answers, but at first, the idea sounds good! Congratz.

@charles-dyfis-net
Copy link
Author

Regarding example use case -- my automated deployment scripts export PIP_INPUT_wipe_when_possible='*(w)ipe*' PIP_ACTION_wipe_when_possible='w' PIP_NO_INPUT=1 to the environment before trying to pull in new requirements. As this is a script being deployed across a cluster of servers, manual human input isn't possible.

I hadn't considered Python 3; that's a good point.

@jezdez
Copy link
Member

jezdez commented Jan 20, 2012

Applied a slightly different patch, see #365.

@jezdez jezdez closed this Jan 20, 2012
@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

Successfully merging this pull request may close these issues.

3 participants