taylor / kiex

Elixir version manager
http://taylor.github.io/kiex/
MIT License
766 stars 65 forks source link

.elixir-version support #54

Closed gitviola closed 2 years ago

gitviola commented 7 years ago

Support for .elixir-version file

This is the first approach to support .elixir-version files. It's inspired by rbenv for rubylang.

Commands

If none of these files are present it tells you to pass a version number along with the command.

ThijsWouters commented 7 years ago

I like the idea. But why would you add another file, when you can get the same information out of mix.exs.

tsubery commented 7 years ago

@ThijsWouters mix.exs defines elixir versions that are compatible with the project. This is not necessarily the same as the version a specific environment uses. For example. A project can support version 1.2 but use 1.3 for development.

gitviola commented 7 years ago

@ThijsWouters I was thinking of that first (or even write a method that returns the version number. But if there is no Elixir version installed at all it would be a pain to parse the mix.exs file since it can't be run.

On Thu, 8 Dec 2016 at 00:21, Gal Tsubery notifications@github.com wrote:

@ThijsWouters https://github.com/ThijsWouters mix.exs defines elixir versions that are compatible with the project. This is not necessarily the same as the version a specific environment uses. For example. A project can support version 1.2 but use 1.3 for development.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/taylor/kiex/pull/54#issuecomment-265605441, or mute the thread https://github.com/notifications/unsubscribe-auth/ACjHHXELPGBaEPBwe-yHMKLZ61FkOUJVks5rFz9mgaJpZM4JpSEI .

ThijsWouters commented 7 years ago

@schurig You don't need elixir or mix to parse the file, grepping works. The major pain would be something like "~> 1.2".

@tsubery Why would you develop in a different version than the minimum supported version? Wouldn't that increase the chance of using a function that is added to the newer version?

tsubery commented 7 years ago

@ThijsWouters I can think of a few reasons, Maybe you want security and performance benefits, avoiding specific bugs with some versions that don't affect the functionality of the project you are working on (maybe something with IEx?). You might also use the same elixir version on many different projects and want to work with one version that is compatible with all of them. Anyway, compatibility issues can arise when upgrading versions as well as downgrading so CI testing matrix is the way to go.

keithmattix commented 6 years ago

Any progress on this? I would really like to see this feature

joshsmith commented 6 years ago

Just pinging to see if there is any chance of using this or something similar.

Stratus3D commented 6 years ago

Hi all, asdf-elixir maintainer here. I'd also like to be able to get the Elixir version out of the project's mix.exs file. I've looked around and there doesn't seem to be a canonical way of accessing it without executing the file. But in order to execute the file, you must choose an Elixir version, which you cannot do until you know what version you should be using.

Of course grepping the file is an option, but it doesn't seem like a very elegant or reliable solution. Anyone have any thoughts on this?

I've opened up https://github.com/asdf-vm/asdf-elixir/issues/48 for this issue.

kovpack commented 4 years ago

Any update on this?

Stratus3D commented 4 years ago

@kovpack see https://elixirforum.com/t/elixir-version-file-proposal/22422