8000 Add submit argument to allow skipping virtualenv requirement install by pkatseas · Pull Request #421 · pystorm/streamparse · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add submit argument to allow skipping virtualenv requirement install #421

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

Merged

Conversation

pkatseas
Copy link
Contributor
@pkatseas pkatseas commented Feb 7, 2018

This adds a CLI argument to the submit command, allowing the user to skip installing virtualenv requirements.

This is especially handy for situations where the virtualenv for a topology is already set up and the topology is getting resubmitted consecutively (e.g. for testing purposes).
This is already achievable via the install_virtualenv: false option in config.json, but I think a CLI flag that controls that behaviour is useful too.

I've only added it to the submit command, and not update_virtualenv, as it's rather counter-intuitive to want to run update_virtualenv but not install requirements.

@coveralls
Copy link
coveralls commented Feb 7, 2018

Coverage Status

Coverage remained the same at 48.216% when pulling 0c33116 on pkatseas:allow-skipping-virtualuenv-creation into 7a5aa66 on Parsely:master.

Copy link
Member
@dan-blanchard dan-blanchard left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. The change here is quite useful, but I think there's a simpler way we could implement it without needing to introduce a new setting. Please see my comment.

@@ -161,7 +162,7 @@ def submit_topology(name=None, env_name=None, options=None, force=False,
use_venv = env_config.get('use_virtualenv', True)

# Check if user wants to install virtualenv during the process
install_venv = env_config.get('install_virtualenv', use_venv)
install_venv = env_config.get('install_virtualenv', not skip_virtualenv)
Copy link
Member
@dan-blanchard dan-blanchard Mar 27, 2018 8000

Choose a reason for hiding this comment

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

A change that would be more consistent with our recent changes would be to change this line (and the use_venv line above it) to read

use_venv = options.get('use_virtualenv', True)
install_venv = options.get('install_virtualenv', use_venv)

And put that after we call resolve_options.

That would let people specify sparse submit -o install_virtualenv=False to skip that installation without needing to create a new setting, or change any other code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dan-blanchard Thanks for the excellent suggestion, this is way cleaner!
I've reverted my changes and implemented that in 0c33116, let me know if that looks good to you.

Panos Katseas added 2 commits March 27, 2018 18:25
Instead of using only `env_config`, we use the resolved options
which take into account options overwritten via CLI.
@dan-blanchard dan-blanchard merged commit 8500325 into pystorm:master Apr 10, 2018
@pkatseas pkatseas deleted the allow-skipping-virtualuenv-creation branch April 10, 2018 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0