Improved Python Version Management and Caching on Codeship Basic

Written by: Dennis Newel

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 virtualenv to 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: 2.7.13, 3.4.6, 3.5.3, 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.

Stay up to date

We'll never share your email address and you can opt out at any time, we promise.