equinor / komodoenv

Komodoenv is the virtualenv of the Komodo world
GNU General Public License v3.0
1 stars 3 forks source link

Provide a better message when in a non-symlinked komodo release #20

Closed pinkwah closed 3 years ago

pinkwah commented 3 years ago

komodoenv will not work if you are in a non-symlinked komodo release. That is, if you've sourced stable-py36, then simply doing komodoenv kenv will create it based on whatever specific version stable-py36 is, and mark the environment as targetting stable-py36.

However, suppose you source 2020.10.b8-py36 and none of stable, testing, unstable or bleeding point to it. I considered this to be dangerous, so I decided not to do anything in this case, and have komodoenv fail unless you specify a release with --release=.

1: Is this a good idea? 2: If it is, provide a message that will tell the user of the dangers and suggest running komodoenv, but with --release specified.


https://github.com/equinor/komodoenv/blob/2ebcd9d3992e3059168a49bf94b2b03475aab122/komodoenv/__main__.py#L60-L62

jondequinor commented 3 years ago

I think making Komodo environments auto-detected off of transient releases is a very legitimate use case for developers and power users. It should be hard to do however, so as to aid non-power users in not making the mistake of targeting a release that is to be deleted and impossible to track.

You could maybe compare this with virtualenv's own --no-download? There are use cases for it but not for the regular user.

I suggest --no-update and a warning about possible deletion, and a failure if the switch isn't turned on.

Point is, you don't have to spell out the release name (information the tool already should have) and you also clarify intent. Ie. I want it to not update, or it was my intention to be silly or whatever.

pinkwah commented 3 years ago

Yes. I was thinking of something like:

(2019.01.10)$ komodoenv kenv
Error: Your current komodo release (2019.01.10) is a transient release and will not be able to update. If you intended to create a non-updatable komodoenv, use:
    $ komodoenv --release=2019.01.10 kenv
jondequinor commented 3 years ago

Part of my point was that you wouldn't have to specifically enter the release name, just a generic option.

Or are you saying you want the specific release name to be entered?

pinkwah commented 3 years ago

I can do either really. I think there are nice arguments for both versions of the solution (which is to not allow by default, but give a message with a work-around).

In your example, maybe we can have --no-track and --track=testing, with the added benefit of being able to go around the (currently broken) heuristic.

pinkwah commented 3 years ago

Added --no-update option. Hopefully it has a sufficiently informative message. Closing.