Skip to content

Conversation

@pkatseas
Copy link
Contributor

This makes the update_virtualenv CLI command respect virtualenv_flags found in the environment config, while prioritising the respective flags found in options first.

It looks like this commit took away the ability to configure virtualenv_flags at the environment level, which silently broke our configuration when creating new virtualenvs.

@coveralls
Copy link

coveralls commented Mar 27, 2018

Coverage Status

Coverage decreased (-0.03%) to 48.189% when pulling 8ae0d3c on pkatseas:virtualenv-flags into 8500325 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! Sorry this has been causing you issues.

I think there's a simpler fix, so if you could update your PR to try it and let me know if it works for you, I'd appreciate it.

storm_options = resolve_options(options, env_config, topology_class, topology_name)
activate_env(env_name, storm_options, config_file=config_file)

virtualenv_flags = options.get('virtualenv_flags', env_config.get('virtualenv_flags'))
Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure this won't be necessary if you fix the typo that is at the heart of the issue.

execute(_create_or_update_virtualenv, env.virtualenv_root, virtualenv_name,
requirements_paths,
virtualenv_flags=options.get('virtualenv_flags'),
virtualenv_flags=virtualenv_flags,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of this, change options.get to storm_options.get here and I think you should be good. Looks like I missed one when I was updating things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the speedy response @dan-blanchard!

I've tried out this suggestion, but it doesn't quite work as intended.
From what I can gather, when the prioritisation of configs is worked out in common.py, it's only the options part that gets applied to storm_options, therefore not capturing the virtualenv config such as virtualenv_flags.
(As a side note, I kinda took the name storm_options to mean config only relevant to Storm.)

I figured that since virtualenv_flags is the only argument that gets passed explicitly to _create_or_update_virtualenv, it would be easier to determine its value at that point instead of further complicating config resolution in resolve_options.
Would you suggest making resolve_options aware of more keys in the env config?

@dan-blanchard
Copy link
Member

Replaced by #453.

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