Reading Time: 2 minutes
We’re excited to announce that we’ve Improved version management and caching for Python on Codeship Basic. You don’t need to change anything right now for existing projects, but you may need to update your configuration to make use of the new functionality.
The main change to version management is that we’re switching from
pyenv and no longer rely on the default Ubuntu versions. Virtualenv will continue to work, but you’ll find it easier and quicker to switch to pyenv. To use pyenv, you can either set PYENV_VERSION (instead of PYTHON_VERSION) to your desired version, or put the version in a
.python-version file and check that into your repo. We’ll make sure to use the correct version, as long as that version is installed. If you are using a version that is not installed, you will need to install it in your setup commands. By default, the following versions are pre-installed:
3.6.1 though we recommend you specify minor versions (e.g.
3.5) to get patch updated without having to update your setup script every time.
You can still install other versions if you’d like; just specify that version in the variable/file and we’ll take it from there. No more scripts or other workarounds.
The new caching is even easier; it’s on by default and you don’t have to change anything. Any dependency you install via pip will automatically be cached between builds.
Naturally, all of this is also explained in our documentation where you can also learn more about how the caching works.