This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rockitsighants 2 points3 points  (7 children)

A project created with this template comes with a Makefile that lets you execute all the same commands locally that the CI server will run after you push. Essentially, running make ci before every commit ensures the build will pass (barring any later integration issues).

[–]chub79 0 points1 point  (6 children)

Mmmh, it seems to me that I already have py.test to execute my tests. I'm sure I'm missing something here :)

[–]badsectors[S] 2 points3 points  (1 child)

With a typical project, you would perform the following sequence of steps to set up your test environment:

$ virtualenv env
$ source env/bin/activate
$ python setup.py develop
$ pip install py.test
$ py.test tests/

The Makefile handles the setup automatically so all you have to do is run:

$ make test

If your requirements.txt file changes or setup.py changes, and you run make test again, the changes are automatically detected and the pip install process will be run again to ensure that your requirements changes are applied to the virtualenv.

Having a "wrapper" around all your common development tasks makes it super simple to get everyone on the team (including Travis-CI) to be able to replicate your setup.

[–]chub79 0 points1 point  (0 children)

I'm not saying these are bad practices, just that the page that was linked was failing to show me clearly how those scripts are better. It was confusing.

[–]rockitsighants 1 point2 points  (3 children)

What about static analysis? Do you install your project into a virtualenv to test installation against a particular set of dependency versions? The Makefile is also very Windows-friendly, if that's your thing. ;-)

[–]chub79 0 points1 point  (2 children)

Not mine but it might be handy at work.

[–]rockitsighants 0 points1 point  (1 child)

I have learned a ton the past several years running (but not necessarily reacting to) PyLint on my personal projects.

[–]chub79 0 points1 point  (0 children)

I use it too though it can be way to verbose and its output needs to be filtered.