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
base: develop
from

Conversation

Projects
None yet
3 participants
@charles-dyfis-net

charles-dyfis-net commented Sep 7, 2011

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.

Charles Duffy
Allow ask()-based questions to be answered in the environment
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

This comment has been minimized.

Show comment
Hide comment
@hltbra

hltbra Sep 15, 2011

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@charles-dyfis-net

charles-dyfis-net Sep 15, 2011

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.

charles-dyfis-net commented Sep 15, 2011

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

This comment has been minimized.

Show comment
Hide comment
@jezdez

jezdez Jan 20, 2012

Contributor

Applied a slightly different patch, see #365.

Contributor

jezdez commented Jan 20, 2012

Applied a slightly different patch, see #365.

@jezdez jezdez closed this Jan 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment