Announcing Python and Perl support on Travis CI
Just shy of a week ago we announced support for Java, Scala, and Groovy. Well, we thought to ourselves 'we already support 8 languages, why not more?', and MOAR you shall have!
Today we are happy to announce first class support for Python and Perl projects!
Adding support for Perl and Python was a no brainer for us, not that it was easy, because it wasn't, but that both languages were sought after by their respective communities and completes the quest for the three P's (PHP, Perl, and Python).
Perl, which has been around since 1987 (Genesis "Land Of Confusion") and has a toolset just as strong and mature as its community. For example, the Perl community has had a variation of Travis for the last 10 years called CPANTesters, with the difference being that CPANTesters tests releases while we test active development.
Python, around since the early 90's (think MC Hammer "Too Legit to Quit", 1991), and in fact it's OLDER than Java! It is used for pretty much EVERYTHING you can think of, from research at CERN, building websites (YouTube and DISQUS), scripting for Games (Battlefield 2), and scripting for Graphics programs (Autodesk Maya, GIMP, Panda3D and Blender to name a few). You may have used Python and didn't even know it!
Wait, What Is Travis CI Anyway?
Travis CI is a distributed continuous integration for the open source community. It is integrated with GitHub and offers first class support for multiple technologies. Our CI environment provides many tools, libraries, and services (MySQL, PostgreSQL, Redis, RabbitMQ, MongoDB and so on), and you don't have to bother setting up your own CI server.
You can watch build logs in near-real time in your browser, access logs later, and even link to log line numbers (for example, when reporting an issue).
Thanks to GitHub integration, Travis CI lets your contributors effortlessly add their development forks to test work-in-progress branches and makes your CI status very visible to the community thanks to our CI badges.
Started in early 2011, Travis CI has since run half a million builds for over 6,000 open source projects, including Ruby, Ruby on Rails, RubyGems, Node.js, Leiningen, Symfony and many more.
Getting Your Python Project on Travis CI
Travis CI provides multiple Python and Perl versions to test against. To get started, you need to add one file (.travis.yml) and the GitHub hook as described in the Getting Started guide. A minimal .travis.yml would look like this:
language: python python: - "2.6" - "2.7" - "3.2" # command to install dependencies install: pip install -r requirements.txt --use-mirrors # command to run tests script: nosetests
Getting Your Perl Project on Travis CI
Travis CI provides three Perl versions to test against. To get started, you need to add one file (.travis.yml) and the GitHub hook as described in the Getting Started guide. A minimal .travis.yml would look like this:
language: perl perl: - "5.14" - "5.12"
Travis CI will will run widely used
cpanm --installdeps --notest .
command to install your project's dependencies. For running tests, Travis CI will try to detect
Makefile.PL file in your repository root
and will run either
perl Build.PL && ./Build test
perl Makefile.PL && make test
Travis' build workflow usually is
- Clone your repository from GitHub
- Pick language/runtime version to use
before_installcommands (can be more than one)
- Install dependencies. This will use cpanm for Perl and pip for Python. You can override the command using the
installkey in your .travis.yml.
- Run one or more
- Run the
perl Makefile.PL && make test. This too can be overriden in .travis.yml. Python projects are required to provide
- Report the build has finished running.
To learn what tools and services (MySQL, Postgres, Riak, etc.) are available in the CI environment, refer to the CI environment guide.
Thank You Contributors
Also, if you have a spare minute, send a HUGE thanks to Michael Klishin who works day and night (seriously, we can not figure out when he sleeps, or if he sleeps!) maintaining the VMs and making sure they are up to date. He was the driving force behind adding support for JVM languages (first Clojure, later Java, Scala, Groovy), and was instrumental in adding Python and Perl support. So please send him a tweet to say thanks, because without Michael we would still be at just Ruby support!
Python and Perl support brings the total number of languages supported by Travis CI to 10. We love adding support to even more languages, but we think for now we need to focus on features like pre-tested pull requests that will benefit all projects, regardless of the language.
If you want to help us make Travis CI even better, consider making a donation.