Cel Skeggs Cel Skeggs - 7 months ago 34
C Question

How to use python 3 as a build script in non-python travis configuration?

I'm trying to use Travis CI on a C library that uses custom python3-based build scripts.

When the repository gets built, it fails on

because configure uses Python 3, which isn't installed by default.

If I were building a Python project, I would use this in my

- "3.4"

However, this doesn't seem to affect my repository because it is in C. (I tried running
which python3
python --version
, which reported that python 3 didn't exist and python 2.7 was in use instead.)

The build script that I tried:

language: c

- "3.4"

How can I have Python 3 available in Travis CI when my project is not a Python project?


You should be able to just install the needed python3 packages by adding a before_install: section of your .travis.yml:

- sudo apt-get update
- sudo apt-get install python3