Re: Playing with git-buildpackage

2014-08-24 Thread Stuart Prescott

To add a different story to git-buildpackage, here are a couple of stories of 
updating packages to new upstream versions that I hope are helpful. I'm 
concentrating on the updating stage here because the importing/creation of a 
new git repo for packaging should be a trivial step (if it's not, there's 
something very wrong), while the process of updating to a new upstream version 
is always going to be the step that requires thought.

My approach here could perhaps be described as a lowest common denominator 
approach but my intention here is just to keep it simple. I feel that we have 
a tendency to overthink our solutions to deal with every single corner case 
imaginable and as a result we construct extraordinarily complex wrappers 
around wrappers around helpers around wrappers with command line options for 
everyday use that make a PhD thesis look short. They become a massive barrier 
to new contributors and, much of the time, don't help us as much as we'd like 
to believe.

So... in summary, below you will find:

 * git for the source package: I need to work on the source so the full 
source needs to be there.
 * git-buildpackage imports tarballs, builds and tags things.
 * quilt patches are managed by quilt. (If I'm sending patches to an 
upstream, I'm probably attaching them to a bug tracker anyway, so I can
just attach the file from debian/patches/ -- if I'm importing a patch from
upstream, I can use either `quilt import` or `patch` or even just copy 
it into debian/patches/. And I do this so rarely that it's not worth
learning lots of new tools to cover the case where the exact same 
patch has been applied both upstream and in the package)
 
I'm sure there are some whose interactions with upstreams, workflows and 
packages warrant more sophistication in the packaging helpers. Great! Let's 
not push very complicated helpers at people who don't necessarily need them. 
Let's not require everyone to become a git guru to be able to work on a simple 
package. Ideally, let's try to make sure that it actually doesn't matter which 
of the 3 workflows we've recently outlined are used because the artefacts in 
the git repo on alioth are the same in all cases.

(Thanks for the inspiration, Barry)


## i18nspector

I have explicitly set the keyid in ~/.gbp.conf and have a debian/gbp.conf 
requesting signed tags so I am prompted for my passphrase during importing to 
sign the tags. I know that this upstream is sane and won't have put crap into 
the tarball that I need to keep out of git so I can just let pristine-tar 
commit it straight away. 

$ uscan
[…]
$ git-import-orig ../i18nspector-0.16.tar.gz
[…]
(yes, I should learn to type `gbp import-orig` instead)

I like to check what crazy^Wcool things upstream has been doing in this 
release, and also to look for new files, new copyright statements, bugs that 
are fixed etc. The following is why I really like having the upstream source in 
the git repo rather than having it separate.

$ git diff --stat upstream/0.15 upstream/0.16
[…]
 44 files changed, 1571 insertions(+), 717 deletions(-)
$ git diff upstream/0.15 upstream/0.16

This upstream is good to work with -- he makes packaging easy. I don't 
actually have any patches to update anyway. I did notice in my review that the 
new version fixes a bug.

$ dch -v 0.16-1 "New upstream version."
$ dch --closes 753946
$ git commit debian/changelog -m"Add changelog for new upstream version"

I always do out-of-tree builds -- it's a way of avoiding the different 
behaviour of the vcs build helpers and it's also means that if I've got stuff 
removed in the clean target I don't have to worry about making the tree dirty. 
I could (should?) probably figure out the correct incantation for git-
buildpackage to have this happen for me as Barry did (`--git-export=WC` by the 
looks of it)... but I just run what amounts to `dpkg-buildpackage -nc -S -us -
c; sbuild ../foo.dsc` (yes, I have a short script that does that for me in the 
same way as everyone has enormously complicated aliases for svn-bp -- it also 
suppresses signing of the test builds). sbuild is configured to run lintian for 
me too. 

Now because I know this particular upstream produces good releases and the diff 
looked pretty safe, I'll take an "optimistic" approach here and assume that 
what I've got is going to be ok and build and tag at the same time. I can 
always come back and `git commit --amend` if I need to later since I've not 
pushed this work:

$ dch -r unstable
$ git commit debian/changelog -m"Prepare changelog for release"
$ git-buildpackage --git-tag
[…]

As Barry noted, gbp throws up a dbus notification that this has finished. I 
quite like that, especially when I'm working on packages that take a long time 
to build (lots of C++ stuff or piles of documentation that requires all of 
texlive to be installed etc). Yes, Barry, you can disable that with --git-
notify=off (or in your ~/.gbp.conf).

Now this package has some

Re: Playing with git-buildpackage

2014-08-24 Thread Barry Warsaw
Hi Stuart,

Great post, thanks for the additional stories.  An emerging theme is that it
may be possible to allow for a wider variety of individual preferences if we
establish a set of team-wide conventions, and perhaps work with the helpers so
that they are more interoperable.

What I mean by this is that, let's say you like using straight-up quilt and I
prefer gbp-pq.  There's no reason in theory why we couldn't both be happy
using the tools we like, even co-maintaining the same package, as long as the
end result is at least compatible, such that I could review, reproduce, and
consume what you did, and vice versa of course.

What that entails is a survey of the conventions that each helper (or
non-helper workflow) expects, such as tag and branch names.  Currently git-dpm
and gbp use different tag names - that seems silly, and we could push both
helpers for convergence.  Similarly for default branch names; I think these
are already the same in both helpers, but we would enforce a team convention
that we don't stray from the defaults.  Or perhaps we can relax that a bit and
say, you can do something different, but you must document it in README.source
so other teammates can play along nicely.

We do need to be opinionated in the documentation though.  Just as the
LibraryStyleGuide has a strong opinion (largely by mentioning, but not
directly documenting the alternatives), our team packaging docs would do the
same.  I think that's an easier task though, and needn't be a blocker for team
conversion to git.

DC14 jetlag is kicking in, so I'll leave it at that for now. :)

-Barry


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140824210649.6f58aa4e@anarchist



Re: guardian and django1.7

2014-08-24 Thread Brian May
As an experiment, I imported django-guardian from the *.dsc files to git
using git-dpm, and applied my changes. Not sure if I have got this right,
it was the first time I used git-dpm.

The result is currently at:
https://github.com/brianmay/django-guardian/tree/patched (patched branch).
This is temporary only, as I am not the maintainer for this package.

This fixes some of the easy Django 1.7 issues, however, I am still stuck on
the CircularDependencyError mentioned above.

At the moment, am wondering if maybe this is a Django 1.7 bug.