Estimated Reading Time: 2 mins
We use pyenv to manage Python environments for you.
By default, we run Python version
2.7.13, but versions
3.6 are all preinstalled as well.
You have several options to specify which Python version you would like to use.
In your setup commands you can use pyenv commands. For instance:
pyenv local $version
You can also use the environment vairable
PYENV_VERSION to choose from one of the installed Python versions.
Alternatively, you can specify a version to use by committing a file named
.python-version into your code repository with a version specification.
You can use pip to install any dependencies in your setup commands.
pip install -r requirements.txt
Codeship automatically caches all dependencies installed through
pip. You can read this article to learn more about the dependency cache and how to clear it.
Due to Python version issues, you may find it helpful to tests your commands with different versions via an SSH debug session if tests are running differently on Codeship compared to your local machine.
As we use pyenv, if an executable is not available after installation you may need to run the command
pyenv rehash after installing the package. You can read pyenv’s documentation for more information.
All Python frameworks, including Django, Flask and Pyramid, should work without issue as long as they do not require root-access for customized system configuration.
All test frameworks and tools, including pytest and unittest, should also work without issue.
In addition to parallelizing your tests explicitly via parallel pipelines, you may find that there are packages available for parallelizing different types of testing, such as nose-parallel, to speed your tests up.
While we do not officially support or integrate with these modules, many Codeship users find success speeding their tests up by using them. Note that it is possible for these modules to cause resource and build failure issues, as well.