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

Global site packages: add query and force-set options #181

Closed
3 tasks done
airwoodix opened this issue May 31, 2020 · 5 comments
Closed
3 tasks done

Global site packages: add query and force-set options #181

airwoodix opened this issue May 31, 2020 · 5 comments

Comments

@airwoodix
Copy link
Contributor

  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.
  • I am willing to lend a hand to help implement this feature.

Feature Request

While working on #173, my main problem with vf globalpackages came up again: toggling is really not the most ergonomic interface to this setting. Usually, I know what I want to do: enabling or disabling global site packages.

The current (toggling) behavior is compatible with virtualenvwrapper and should therefore remain the default. What about extra options for query and force-set?

  • vf globalpackages -s|--status: query status -> true|false
  • vf globalpackages true|false: set status explicitly

For the query, -q is not an option since it should be reserved for --quiet (could be added on the same occasion, see virtualenvwrapper).

Alternatively, dropping the virtualenvwrapper compatibility, vf globalpackages could display the status and vf globalpackages toggle would toggle the setting.

Comments most welcome!

@justinmayer
Copy link
Owner

My initial thought is that we could leave the current bare vf globalpackages behavior as-is and add vf globalpackages on & vf globalpackages off sub-commands.

I'm not sure I understand the benefit of querying the status. Presumably the idea is to make sure the state is set on or off as desired in that moment, at which point it would probably make more sense to just set it on or off (even if it's already in that state).

@airwoodix
Copy link
Contributor Author

Thanks for the feedback.

My initial thought is that we could leave the current bare vf globalpackages behavior as-is and add vf globalpackages on & vf globalpackages off sub-commands.

Yes, that works as well. My main problem with the current behavior is that "toggle" is really not what I would expect from this command if knowing nothing about it. But backwards compatibility should be maintained.

I'm not sure I understand the benefit of querying the status. Presumably the idea is to make sure the state is set on or off as desired in that moment, at which point it would probably make more sense to just set it on or off (even if it's already in that state).

Indeed. The operation is really inexpensive so just forcing the state is simple enough. Querying is what I would expect from the current command since it has no verb/action but this as probably no real use case.

I can work on this once #173 is merged.

@justinmayer
Copy link
Owner

Hi Etienne. Since your previous PR has been merged, so you want to submit a PR for the other functionality discussed here?

@justinmayer
Copy link
Owner

Hi Etienne. Once you are ready to work on querying the status (as discussed above), let me know so we can re-open this issue. Cheers! 👋

@airwoodix
Copy link
Contributor Author

Sorry for the very long delay. I finally prepared a PR for this feature #193. Thanks for your patience @justinmayer!

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

No branches or pull requests

2 participants