9

Why Travis CI is great for the Python community

 3 years ago
source link: https://alexgaynor.net/2014/jan/06/why-travis-is-great-for-the-python-community/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Why Travis CI is great for the Python community · Alex Gaynor

Alex Gaynor

Hi, I'm Alex. I've been CISO at a startup named Alloy, an engineer working on Firefox security, and before that at the U.S. Digital Service. I'm an avid open source contributor and live in Washington, DC.

© 2020. All rights reserved.

Why Travis CI is great for the Python community

Mon, Jan 6, 2014

In the unlikely event you’re both reading my blog, and have not heard of Travis CI, it’s a CI service which specifically targets open source projects. It integrates nicely with Github, and is generally a pleasure to work with.

I think it’s particularly valuable for the Python community, because it makes it easy to test against a variety of Pythons, which maybe you don’t have at your fingertips on your own machine, such as Python 3 or PyPy (Editor’s note: Why aren’t you using PyPy for all the things?).

Travis makes this drop dead simple, in your .travis.yml simply write:

language: python
python:
    - "2.6"
    - "2.7"
    - "3.2"
    - "3.3"
    - "pypy"

And you’ll be whisked away into a land of magical cross-Python testing. Or, if like me you’re a fan of tox, you can easily run with that:

python: 2.7
env:
    - TOX_ENV=py26
    - TOX_ENV=py27
    - TOX_ENV=py32
    - TOX_ENV=py33
    - TOX_ENV=pypy
    - TOX_ENV=docs
    - TOX_ENV=pep8

script:
    - tox -e $TOX_ENV

This approach makes it easy to include things like linting or checking your docs as well.

Travis is also pretty great because it offers you a workflow. I’m a big fan of code review, and the combination of Travis and Github’s pull requests are awesome. For basically every project I work on now, I work in this fashion:

  • Create a branch, write some code, push.
  • Send a pull request.
  • Iteratively code review
  • Check for travis results
  • Merge

And it’s fantastic.

Lastly, and perhaps most importantly, Travis CI consistently gets better, without me doing anything.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK