Update debian/rules to run `./setup.py test` during build

Bug #822413 reported by Jason Gerard DeRose on 2011-08-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Michael Chang

Bug Description

During Barry Warsaw's App Developer Week session, he mentioned how to make debian/rules run `setup.py test` during a build, so that tests are run during daily Launchpad builds and so on. Here's the IRC log:


And an example debian/rules (but we need Python3 only):


Related branches

Michael Chang (thenewme91) wrote :

Tried to take a stab at this, but for some reason, when I call "debuild -S", debhelper is calling python 2.6 instead of python 3.2 on my system:


I'm not sure if it's appropriate to add a debian/pyversions file as mentioned in this wiki page:


Adding a debian/pyversions file makes debuild and dput work nicely on my system.

For now lp:~thenewme91/filestore/lp822413 contains semi-tested changes (without debian/pyversions). Adding a debian/pyversions file with the content "3.2-" causes the package to build fine in my PPA.

Also, I'm not 100% sure if I changed the changelog correctly / should be changing the changelog at all.

Jason Gerard DeRose (jderose) wrote :

Michael, thanks so much for taking a stab at this!

As far as the changelog... this has confused me for a long time, but I recently got some clarification, think I finally get it: as far as packaging policy, the changelog only matters for official packages where the changes actually land in the archive. If you're, say, building in a PPA in preparation to get a new package reviewed... you'll have only one entry in the changelog when you submit it for review, regardless of how many revisions you went through in PPA builds.

That said, this is just "unofficial" packaging for the sake of our daily builds, so we can basically do whatever we want... but I think it makes sense to have only 1 entry in the changelog, so the package revision is incremented nicely by just the bzr revno.

Would you mind reverting the changelog, and then proposing this for merge? If it's working in your PPA, I think it's good to go. Do the build logs make it clear that the tests were actually run?

The debuild error is weird... I get the same thing trying to run debuild in the current filestore trunk on my system, yet it's been building fine in the Novacut PPA for months.

Thanks again! Awesome to have someone new joining in on the fun! :-)

Michael Chang (thenewme91) wrote :

Changelog reverted; merge proposed.

The tests definitely ran on my last successful upload, although there seem to be some unusual warnings that might need following up on. How did you get it to build in the PPA if you can't run debuild?

Definitely excited about this and novacut in general. :)

Changed in filestore:
assignee: nobody → Michael Chang (thenewme91)
status: Triaged → Fix Committed
Jason Gerard DeRose (jderose) wrote :

Thanks again, Michael!

I'll look over the next daily build's logs, see if I can spot anything fishy.

As far as how are the PPA builds actually working... that's something of a mystery! My hunch is that as we don't have Python2 as a build dependency, Python2 probably isn't installed on the build VMs... so Python2 isn't trying to run Python3 code.

I'm going to try and file a lot more bitesize bugs the next few weeks (takes a surprising amount of time and thought to come up with good bitesize bugs)... they're a good way to introduce people to the code, and to Launchpad workflow.

But I just filed another bitesize bug especially for you:


Hope you don't mind that I already assigned you to it :-)

Changed in filestore:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers