See how I do it here: https://github.com/pydy/pydy-code-gen/blob/master/.travis.yml