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

Download of new Python versions #71

Open
DiTo97 opened this issue Nov 22, 2022 · 0 comments
Open

Download of new Python versions #71

DiTo97 opened this issue Nov 22, 2022 · 0 comments

Comments

@DiTo97
Copy link

DiTo97 commented Nov 22, 2022

After experimenting a bit with adding Python versions on Travel, it probably should be tweaked a bit, mainly because it forces you to always have that version of Python in the system, which can be somewhat limiting (e.g., we need a specific image, say in a step of a Bitbucket pipeline, but it doesn't have the right Python version)

I suggest using python-build, a Pyenv plugin that takes care of the whole installation procedure. As you can see from the README, it does not need Pyenv to be installed, but can operate standalone like this:

python-build <python-version> <output-directory>

where <python-version> is the version of Python to install (e.g., 3.7.15) and <output-directory> is where to install it.

It should be quite easy (maybe with Git submodules?) to go and reference Pyenv's plugin directly, so you can keep it up to date, and at the same time change the Travel command to add Python versions to something like:

  1. ​travel config add python <python-version> [<python-location>]​
  2. If the Python version has already been added, ignore the command (or add a flag to force the override)
  3. Is python-location available?
    • If yes, look for the Python binary from there and:
      • if it is not present, raise a FileNotFoundError
      • if it is present, but the binary does not match <python-version>, raise a ValueError
    • If no, run python-build on that version to download the binary to some known internal path
  4. Add that (version, binary) pair to Travel config.yml

N.B.: The above flow chart works only on UNIX-like systems. For Windows systems, we should look for an equivalent standalone plugin in Pyenv-win.

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