You are not logged in.

#1 2016-10-14 05:09:48

timefairy
Member
Registered: 2010-03-05
Posts: 35

[SOLVED] PKGBUILD review request: git-repo

Hey all,

I'm writting the PKGBUILD for https://github.com/guyzmo/git-repo

The PKGBUILD:

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=git-repo
pkgver=1.7.3
pkgrel=1
pkgdesc="Git-Repo: CLI utility to manage git services from your workspace"
arch=('any')
url="https://github.com/guyzmo/git-repo"
license=('GPL2')
depends=('python')
makedepends=('python-pip')
source=("$pkgname-$pkgver.src.tar.gz::${url}/archive/${pkgver}.tar.gz")
md5sums=('7913ae6cc8fa6146abde08c6c923946e')

package() {
  cd "$srcdir/$pkgname-$pkgver"
  python3 setup.py install --root="$pkgdir/"
}

'namcap git-repo-1.7.3-1-any.pkg.tar.xz' shows nothing, which means my PKGBUILD should be OK.

After the installation ('sudo pacman -U git-repo-1.7.3-1-any.pkg.tar.xz'), when I run 'git-repo', it shows the following error:

Traceback (most recent call last):
  File "/usr/bin/git-repo", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2991, in <module>
    @_call_aside
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2977, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 662, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 970, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 856, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'bitbucket-api==0.5.0' distribution was not found and is required by git-repo

Last edited by timefairy (2016-10-14 12:13:30)

Offline

#2 2016-10-14 05:47:40

basica
Member
From: Australia
Registered: 2012-10-31
Posts: 217

Re: [SOLVED] PKGBUILD review request: git-repo

Looks like it's missing dependencies. Does the setup script download and install missing dependencies?

Also it should be name package-git if you're using git repo. Use one of their releases if you're not looking to make a *-git package.

Last edited by basica (2016-10-14 05:49:18)

Offline

#3 2016-10-14 09:00:28

timefairy
Member
Registered: 2010-03-05
Posts: 35

Re: [SOLVED] PKGBUILD review request: git-repo

I tried to install bitbucket-api=0.5.0 with PKGBUILD:

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=bitbucket-api
_pkgname=BitBucket-api
pkgver=0.5.0
pkgrel=2
pkgdesc="Python library to interact with BitBucket REST API"
arch=('any')
url="https://github.com/Sheeprider/BitBucket-api"
license=('ISC')
makedepends=('python-pip')
source=("$pkgname-$pkgver.src.tar.gz::${url}/archive/${pkgver}.tar.gz")
md5sums=('8572395c73b90d87840cc058e1962c27')

package() {
    cd "$srcdir/$_pkgname-$pkgver"
    python3 setup.py install --root="$pkgdir/" --optimize=1

    # License
    install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/bitbucket-api/LICENSE
}

and found another dependency:

Traceback (most recent call last):
  File "/usr/bin/git-repo", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2991, in <module>
    @_call_aside
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2977, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 662, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 970, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 856, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'github3.py==0.9.5' distribution was not found and is required by git-repo

The question is, can I include all these dependencies in one PKGBUILD, or just create a couple of PKGBUILDs?

Btw, BitBucket-api has three dependencies.

Offline

#4 2016-10-14 09:41:17

timefairy
Member
Registered: 2010-03-05
Posts: 35

Re: [SOLVED] PKGBUILD review request: git-repo

I found github3.py in aur, with version 1.0.0a4: https://aur.archlinux.org/packages/python-github3.py/

According to http://stackoverflow.com/a/6572017 , there's no way to install multiple versions of a package with pip.

Is there anyway to install these dependencies within the own folder of git-repo package?

Offline

#5 2016-10-14 12:08:22

timefairy
Member
Registered: 2010-03-05
Posts: 35

Re: [SOLVED] PKGBUILD review request: git-repo

working PKGBUILD using pip directly:

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=python-git-repo
_pkgname=git-repo
pkgver=1.7.3
pkgrel=1
pkgdesc="Tool for managing remote repositories from your git CLI!"
arch=('any')
url="https://github.com/guyzmo/git-repo"
license=('GPL2')
depends=('python')
makedepends=('python-pip')

package() {
    pip install --prefix="$pkgdir/usr" $_pkgname==$pkgver
}

Any suggestion?

Offline

#6 2016-10-15 08:44:45

basica
Member
From: Australia
Registered: 2012-10-31
Posts: 217

Re: [SOLVED] PKGBUILD review request: git-repo

If you can install the software via pip, I'm not really sure there's much of a need for a PKGBUILD but others may feel differently *shrug*.

Offline

#7 2016-10-16 09:57:17

timefairy
Member
Registered: 2010-03-05
Posts: 35

Re: [SOLVED] PKGBUILD review request: git-repo

Since we can install this through pip like:

pip install --user git-repo

I don't think the `pip` PKGBUILD is a mandatory  *shrug*.

Offline

Board footer

Powered by FluxBB