[git-buildpackage] gbp Python

Guido Günther agx at sigxcpu.org
Sat Nov 30 20:42:48 CET 2019


Hi,
On Sat, Nov 30, 2019 at 08:19:43PM +0100, john doe wrote:
> Hi  and thank you for your answer.
> 
> On 11/30/2019 7:55 PM, Guido Günther wrote:
> > Hi,
> > On Sat, Nov 30, 2019 at 07:13:49PM +0100, john doe wrote:
> >> Hi,
> >>
> >> Following the instructions at (1), I can install 'gbp' using pip ('pip
> >> install gbp').
> >>
> >> On Debian Buster, if I install 'git-buildpackage' (apt-get install
> >> git-buildpackage'), and try to import gbp.git as follow it fails:
> >>
> >> Python 2.7.16 (default, Oct 10 2019, 22:02:15)
> >> [GCC 8.3.0] on linux2
> >> Type "help", "copyright", "credits" or "license" for more information.
> >>>>> from gbp.git import GitRepository
> >> Traceback (most recent call last):
> >>   File "<stdin>", line 1, in <module>
> >> ImportError: No module named gbp.Can
> >
> > There's no python2 support in gbp since some time. You want to use
> > either python3 or use pip which gives you a gbp old enough to support
> > python2.
> >
> 
> Okay, I get the following on Python3:
> 
> 
> Python 3.7.3 (default, Apr  3 2019, 05:39:12)
> [GCC 8.3.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from gbp.git import GitRepository
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ModuleNotFoundError: No module named 'gbp'
> 
> 
> Should I do anything special prior to execute the above command?
> 
> 
> In other words, how can I use gbp on Python3.

it just works out of the box:

```
sudo apt install git-buildpackage
...
:~ (master)$ python3
Python 3.7.5rc1 (default, Oct  8 2019, 16:47:45) 
[GCC 9.2.1 20190909] on linux
Type "help", "copyright", "credits" or "license" for more information.
py> import gbp
py> help(gbp)
Help on package gbp:

NAME
    gbp - The various things needed by git-buildpackage and friends

PACKAGE CONTENTS
    command_wrappers
    config
    dch
    deb (package)
    errors
    format
    git (package)
    log
    notifications
    patch_series
    paths
    pkg (package)
    rpm (package)
    scripts (package)
    tmpfile
    tristate
    version

FILE
    /usr/lib/python3/dist-packages/gbp/__init__.py

```

This is on Debian with gbp 0.9.17 what version are you using? Which
distribution? Is python3 from the distro?
Cheers,
 -- Guido


> 
> --
> John Doe
> _______________________________________________
> git-buildpackage mailing list
> git-buildpackage at lists.sigxcpu.org
> http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage


More information about the git-buildpackage mailing list