Skip to content

Add Travis CI config file #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Add Travis CI config file #166

wants to merge 3 commits into from

Conversation

vlasovskikh
Copy link
Member

I suggest running tox tests automatically via the Travis CI that integrates well with GitHub.

@ambv Could you set up a build configuration at Travis CI for this repository? You're the owner of the repository and it seems only you can do it.

Then we could add the Travis badge to the README file to browse the results of automatic builds.

@refi64
Copy link

refi64 commented Oct 28, 2015

Instead of using Tox, you can just use different Python versions like Hy does. That way, at a glance Travis will always say which versions passed and which ones failed. You could do something like:

sudo: false # Use the container infrastructure for faster builds
language: python
python: # Different Python versions
  - pypy
  - "2.7"
  - "3.2"
  - "3.3"
  - "3.4"
script:
  - "[ $TRAVIS_PYTHON_VERSION = 2.7 ] && cd python2 || cd src"
  - python -m unittest discover

Now, if a build fails, the overview screen will show the failing Python versions.

I set up Travis for Mypy and downloaded custom PyPy versions for Hy, so I'm pretty experienced in this part. :D

@vlasovskikh
Copy link
Member Author

@kirbyfan64 It looks like a good idea. Is there any way we could reuse our tox config for particular Travis environments like "2.7"? I'm aware of a way to run tox for a specific environment:

tox -e py27

Maybe we could do something like this:

...
script:
  - tox -e ${TRAVIS_PYTHON_VERSION}  # We need to drop dots or use a map from Travis Python names to tox names

@refi64
Copy link

refi64 commented Oct 28, 2015

I think you can do:

- tox -e py`echo ${TRAVIS_PYTHON_VERSION} | sed 's/\.//'`

@o11c
Copy link
Contributor

o11c commented Oct 28, 2015

bash can do substitutions without sed: py${TRAVIS_PYTHON_VERSION/./}

but I specify the TOX_ENVs manually via matrix: include rules, since it's more obvious that way, and also supports pypy.

@vlasovskikh
Copy link
Member Author

@o11c matrix looks like the best option for our case.

@vlasovskikh
Copy link
Member Author

I've tested this .travis.yml file for my own clone, it works OK. Builds are failing for Python 2.7 because this branch doesn't include the latest commits from master.

@vlasovskikh
Copy link
Member Author

We still need some help from @ambv with setting up the build configuration at the Travis website.

@vlasovskikh
Copy link
Member Author

@ambv Could you please set up a build configuration at the Travis CI server? Since it's your repository you are the only person who can do it. We've prepared the config file in this PR.

@gvanrossum
Copy link
Member

I did something different and simper, since I'm unfamiliar with tox. Closing this one.

@gvanrossum gvanrossum closed this Jan 29, 2016
@gvanrossum gvanrossum deleted the travis-ci branch January 30, 2016 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants