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 ./configure
because configure uses Python 3, which isn't installed by default.
If I were building a Python project, I would use this in my .travis.yml
:
python: - "3.4"
However, this doesn't seem to affect my repository because it is in C. (I tried running which python3
and 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 python: - "3.4"
How can I have Python 3 available in Travis CI when my project is not a Python project?
Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.
If you want to use the container based infrastructure you can make use of the apt addon:
addons: apt: sources: - deadsnakes # source required so it finds the package definition below packages: - python3.5
Packages that can be used are listed here
Update
In order to use dependencies with c-extensions like psycopg2 or pyYAML it is also necessary to add python3.4-dev
You should be able to just install the needed python3 packages by adding a before_install:
section of your .travis.yml
:
before_install: - sudo apt-get update - sudo apt-get install python3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With