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

Python installation semver or matching version #33

Open
Jaymon opened this issue Nov 3, 2020 · 2 comments
Open

Python installation semver or matching version #33

Jaymon opened this issue Nov 3, 2020 · 2 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Nov 3, 2020

Many times I want to install Python 2.7.* or 3.8.*. It would be great to have some basic semver stuff, or even specifying a regex or something, so you could do something like:

$ pyenv install --list | grep "^\s*2.7.*"

and take the last matching line. So specifying:

"version" => "2.7.*"

would get checked against the output of pyenv install --list and the last matching value would be the version that is installed.

If I wanted to use semver syntax, Gem::Version might be useful, to find the latest version

Gem::Version.new('0.3.2') < Gem::Version.new('0.10.1')
@Jaymon
Copy link
Owner Author

Jaymon commented Nov 3, 2020

Using a syntax like 2.7.* means you would only need to run grep against pyenv install --list if there is an asterisk in the version.

@Jaymon
Copy link
Owner Author

Jaymon commented Nov 3, 2020

You need to account for things like:

$ pyenv install --list | grep "^\s*3.*"
  3.4.0
  3.4-dev
  3.4.1
  ...
  3.5.0
  3.5-dev
  3.5.1
  ...
  3.6.0
  3.6-dev
  3.6.1
  ...
  3.7.0
  3.7-dev
  3.7.1
  ...
  3.8.0
  3.8-dev
  3.8.1
  ...
  3.9.0
  3.9-dev
  3.10-dev

Because you probably don't want the -dev build to be installed, or maybe you do ¯_(ツ)_/¯

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

No branches or pull requests

1 participant