You are not logged in.

#1 2016-10-14 12:31:13

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

(WIP) 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=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
}

'namcap python-git-repo-1.7.3-1-any.pkg.tar.xz' output, which should be OK:

python-git-repo E: ELF file ('usr/lib/python3.5/site-packages/gitdb/_perf.cpython-35m-x86_64-linux-gnu.so') found in an 'any' package.
python-git-repo W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/python3.5/site-packages/gitdb/_perf.cpython-35m-x86_64-linux-gnu.so')

Any suggestion?
---
(original post: https://bbs.archlinux.org/viewtopic.php?id=218232)

Last edited by timefairy (2016-10-25 05:38:26)

Offline

#2 2016-10-17 03:33:16

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

Re: (WIP) PKGBUILD review request: git-repo

A working PKGBUILD without `pip`, at least on my machine:

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=python-git-repo
_pkgname=git-repo
pkgver=1.7.4
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-setuptools' 'python-pip')
source=("$pkgname-$pkgver.src.tar.gz::$url/archive/$pkgver.tar.gz"
        'requirements.txt.patch'
        'setup.py.patch')
sha1sums=('9818723314283ed1ce5663d08dc900c986ea5686'
          '4689336862b4e8db09d2ca8f78b79544e32f2e3b'
          '7ec358708c3250907e858028245351157bbb528c')

prepare() {
    cd "$srcdir/$_pkgname-$pkgver"
    patch -Np2 -i "${srcdir}/requirements.txt.patch"

    cp requirements.txt requirements-prod.txt
    patch -Np2 -i "${srcdir}/setup.py.patch"
}

package() {
    local python_version=$(python --version)
    local python_path="$pkgdir/usr/lib/python${python_version:7:3}/site-packages"
    mkdir -p "$python_path"
    export PYTHONPATH=$PYTHONPATH:"$python_path"
    cd "$srcdir/$_pkgname-$pkgver"
    python setup.py install --prefix="$pkgdir/usr" --optimize=1
}

Any suggestion? May I publish it on AUR now?

Offline

#3 2016-10-17 04:39:13

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

Re: (WIP) PKGBUILD review request: git-repo

Offline

#4 2016-10-17 06:12:59

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 677

Re: (WIP) PKGBUILD review request: git-repo

I think this would better have been called git-repo rather than python-git-repo? It seems to have nothing to do with the python language specifically, apart from the minor fact that it happens to be the language it is coded in.

Offline

#5 2016-10-17 07:53:14

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

Re: (WIP) PKGBUILD review request: git-repo

bulletmark wrote:

I think this would better have been called git-repo rather than python-git-repo? It seems to have nothing to do with the python language specifically, apart from the minor fact that it happens to be the language it is coded in.

I renamed the package name to git-repo.

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=git-repo
pkgver=1.7.4
pkgrel=2
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-setuptools' 'python-pip')
source=("$pkgname-$pkgver.src.tar.gz::$url/archive/$pkgver.tar.gz"
        'requirements.txt.patch'
        'setup.py.patch')
sha1sums=('9818723314283ed1ce5663d08dc900c986ea5686'
          '4689336862b4e8db09d2ca8f78b79544e32f2e3b'
          '7ec358708c3250907e858028245351157bbb528c')

prepare() {
    cd "$srcdir/$pkgname-$pkgver"
    # bitbucket-api requires requests==2.2.1
    patch -Np2 -i "${srcdir}/requirements.txt.patch"
    # install requirements
    cp requirements.txt requirements-prod.txt
    patch -Np2 -i "${srcdir}/setup.py.patch"
}

package() {
    # update PYTHONPATH
    local python_version=$(python --version)
    local python_path="$pkgdir/usr/lib/python${python_version:7:3}/site-packages"
    mkdir -p "$python_path"
    export PYTHONPATH=$PYTHONPATH:"$python_path"
    # install with prefix
    cd "$srcdir/$pkgname-$pkgver"
    python setup.py install --prefix="$pkgdir/usr" --optimize=1
}

aur link:
https://aur.archlinux.org/packages/git-repo/

Last edited by timefairy (2016-10-17 07:53:53)

Offline

#6 2016-10-20 05:56:18

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: (WIP) PKGBUILD review request: git-repo

Why the PYTHONPATH kludge, instead of doing what most python PKGBUILDs do and using `python setup.py install --root="${pkgdir}"` ???

Also, you are missing some dependencies which are downloaded at build time and installed as part of this package instead -- you shouldn't do this.
PKGBUILDs should be able to build without an internet connection as long as the sources are downloaded beforehand. (Don't install with pip.)
And dependencies should be packaged separately.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2016-10-25 05:40:15

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

Re: (WIP) PKGBUILD review request: git-repo

Eschwartz wrote:

Why the PYTHONPATH kludge, instead of doing what most python PKGBUILDs do and using `python setup.py install --root="${pkgdir}"` ???

Also, you are missing some dependencies which are downloaded at build time and installed as part of this package instead -- you shouldn't do this.
PKGBUILDs should be able to build without an internet connection as long as the sources are downloaded beforehand. (Don't install with pip.)
And dependencies should be packaged separately.

Thanks, will redo the PKGBUILD

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=git-repo
pkgver=1.7.4
pkgrel=3
pkgdesc="Tool for managing remote repositories from your git CLI!"
arch=('any')
url="https://github.com/guyzmo/git-repo"
license=('GPL2')
depends=('python' 'python-docopt' 'GitPython' 'python-progress' 'python-gitlab'
         'python-uritemplate.py' 'python-github3.py' 'python-bitbucket-api')
makedepends=('python-setuptools' 'python-pip')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
sha256sums=('c307a53e6d46fd6c1f832500b4eb19011f4f9f07607d09fa3b683b4516654e1a')

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

depends 'GitPython' 'python-progress' 'python-bitbucket-api' are missing, will add them asap (AUR not updated yet)

Last edited by timefairy (2016-10-25 06:16:11)

Offline

#8 2016-10-26 01:01:51

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

Re: (WIP) PKGBUILD review request: git-repo

timefairy wrote:

depends 'GitPython' 'python-progress' 'python-bitbucket-api' are missing, will add them asap (AUR not updated yet)

I did some homework in AUR:
'GitPython' in AUR: python-git, https://aur.archlinux.org/packages/python-git/
'python-progress' (python3) not in AUR: python2-progress, https://aur.archlinux.org/packages/python2-progress/
'python-bitbucket-api' not in AUR

Last edited by timefairy (2016-10-26 01:46:07)

Offline

#9 2016-10-26 02:59:53

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

Re: (WIP) PKGBUILD review request: git-repo

Updated PKGBUILD according to https://github.com/guyzmo/git-repo/blob … ements.txt:

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=git-repo
pkgver=1.7.4
pkgrel=3
pkgdesc="Tool for managing remote repositories from your git CLI!"
arch=('any')
url="https://github.com/guyzmo/git-repo"
license=('GPL2')
depends=('python' 'python-docopt' 'python-git>=2.0.6' 'python-progress=1.2' 'python-gitlab=0.13'
         'python-uritemplate.py=2.0.0' 'python-github3.py=0.9.5' 'python-bitbucket-api=0.5.0')
makedepends=('python-setuptools' 'python-pip')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
sha256sums=('c307a53e6d46fd6c1f832500b4eb19011f4f9f07607d09fa3b683b4516654e1a')

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

The following packages in AUR doesn't meet the requirement:
python-gitlab=0.13, out of date
(python-gitlab 0.9.2-1: https://aur.archlinux.org/packages/python-gitlab/)
python-uritemplate.py=2.0.0, newer
(python-uritemplate.py 3.0.0-1: https://aur.archlinux.org/packages/pyth … plate.py/)
python-github3.py=0.9.5, newer
(python-github3.py 1.0.0a4-1: https://aur.archlinux.org/packages/python-github3.py/)

What to do next, do I need to upgrade the python-gitlab too? Any suggestions, please?

Offline

#10 2016-10-26 03:01:20

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

Re: (WIP) PKGBUILD review request: git-repo

Also, two additional packages will push to AUR:

python-progress (REMOVED):

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=python-progress
_pkgname=progress
pkgver=1.2
pkgrel=1
pkgdesc="Easy to use progress bars for Python"
arch=('any')
url="https://pypi.python.org/pypi/progress"
license=('ISC')
makedepends=('python-setuptools')
source=("http://pypi.python.org/packages/source/p/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha256sums=('5b6a50f9ac76820f619d7789b5354881c8c10060a64047e415868d8f503cc2eb')

package() {
    cd "$srcdir/$_pkgname-$pkgver"
    python setup.py install --root="${pkgdir}" --optimize=1
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

python-bitbucket-api:

# Maintainer: Mark Huo <markhuomian at gmail dot com>
pkgname=python-bitbucket-api
_pkgname=BitBucket-api
pkgver=0.5.0
pkgrel=1
pkgdesc="Python library to interact with BitBucket REST API"
arch=('any')
url="https://github.com/Sheeprider/BitBucket-api"
license=('ISC')
depends=('python-requests' 'python-sh' 'python-requests-oauthlib')
source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
sha256sums=('b6ccabde3ae7739dc9fd16218288ac6691680a0f9a97bfd6d2463b68c5058e7c')

package() {
    cd "$srcdir/$_pkgname-$pkgver"
    python setup.py install --root="${pkgdir}" --optimize=1
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Last edited by timefairy (2016-10-26 03:41:52)

Offline

#11 2016-10-26 03:05:26

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: (WIP) PKGBUILD review request: git-repo

Ask the maintainer of python2-progress to add the Python 3 (python-progress) version as a split package.

As for python-gitlab, it is flagged out of date. If the maintainer is unresponsive, you could file an orphan request.

...

Does upstream (git-repo) truly claim that newer versions of some of those requirements will break the module???

Last edited by eschwartz (2016-10-26 03:10:07)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#12 2016-10-26 03:24:45

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

Re: (WIP) PKGBUILD review request: git-repo

Eschwartz wrote:

Ask the maintainer of python2-progress to add the Python 3 (python-progress) version as a split package.

As for python-gitlab, it is flagged out of date. If the maintainer is unresponsive, you could file an orphan request.

...

Does upstream (git-repo) truly claim that newer versions of some of those requirements will break the module???

Thanks
1. python-progress, will ask the maintainer
2. python-gitlab, will ask the maintainer
3. about the requirements version, it show the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 658, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 966, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 857, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (github3.py 1.0.0a4 (/usr/lib/python3.5/site-packages), Requirement.parse('github3.py==0.9.5'), {'git-repo'})

During handling of the above exception, another exception occurred:

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 2994, in <module>
    @_call_aside
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2980, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3007, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 660, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 852, 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

Last edited by timefairy (2016-10-26 03:26:37)

Offline

#13 2016-10-26 03:38:02

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: (WIP) PKGBUILD review request: git-repo

2. The maintainer appears to be ignoring the flagged-out-of-date thing, so you could try contacting him via email, alternatively an orphan request will let you appeal to the TUs who oversee the AUR and have the authority to grant you custody of that package (where presumably you would take better care of it).

3. Yeah -- that is a pkg_resources error, indicating that git-repo is insisting on a versioned dependency. wink
The question is, why does git-repo insist on versioned dependencies of like everything, when python-the-language does not have a culture of backwards-incompatible changes?
Is this just being overcautious -- and hurting people who want to use recent versions of stuff together with git-repo -- or do all those packages mysteriously have breaking backwards-incompatible changes that break git-repo?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#14 2017-01-28 20:06:03

guiniol
Member
Registered: 2013-04-10
Posts: 18

Re: (WIP) PKGBUILD review request: git-repo

Eschwartz wrote:

3. Yeah -- that is a pkg_resources error, indicating that git-repo is insisting on a versioned dependency. wink
The question is, why does git-repo insist on versioned dependencies of like everything, when python-the-language does not have a culture of backwards-incompatible changes?
Is this just being overcautious -- and hurting people who want to use recent versions of stuff together with git-repo -- or do all those packages mysteriously have breaking backwards-incompatible changes that break git-repo?

That seems to be a github3.py problem. The latest version fixes it, we'll just have to wait for the dev to update.

Offline

#15 2017-01-28 20:13:27

zmo
Member
Registered: 2016-08-22
Posts: 9

Re: (WIP) PKGBUILD review request: git-repo

Hello,

I'm the developer of git-repo, and I'm humbled see the interest that's being raised for git-repo, and I'm also an Arch user!
Guiniol just shared this forum thread with me about the issue.

Does upstream (git-repo) truly claim that newer versions of some of those requirements will break the module???

  • for python-progress, I have relaxed the dependency after being contacted about it, so it should be ok now

  • for python-gitlab, 0.18 is indeed the minimal requirement as I have pushed some patches to this lib to support git-repo

  • for github3.py and uritemplate see this issue for more details, but it's supposed to be solved with 1.0, but as sigmavirus24 broke the API, I need to make a new release.

I'll subscribe to this thread, but I'm not very comfortable with phpbb forums. Don't hesitate to ping me on IRC, I'm zmo on freenode.

Last edited by zmo (2017-01-28 21:15:04)

Offline

#16 2017-03-24 07:55:41

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

Re: (WIP) PKGBUILD review request: git-repo

zmo wrote:

Hello,

I'm the developer of git-repo, and I'm humbled see the interest that's being raised for git-repo, and I'm also an Arch user!
Guiniol just shared this forum thread with me about the issue.

Does upstream (git-repo) truly claim that newer versions of some of those requirements will break the module???

  • for python-progress, I have relaxed the dependency after being contacted about it, so it should be ok now

  • for python-gitlab, 0.18 is indeed the minimal requirement as I have pushed some patches to this lib to support git-repo

  • for github3.py and uritemplate see this issue for more details, but it's supposed to be solved with 1.0, but as sigmavirus24 broke the API, I need to make a new release.

I'll subscribe to this thread, but I'm not very comfortable with phpbb forums. Don't hesitate to ping me on IRC, I'm zmo on freenode.

Hi guys,

I'm busy with my own projects, and afraid of dropping the repo for now. Anyone want to adopt it would be appreciated.

Offline

#17 2017-05-06 20:58:42

guiniol
Member
Registered: 2013-04-10
Posts: 18

Re: (WIP) PKGBUILD review request: git-repo

timefairy wrote:

Hi guys,

I'm busy with my own projects, and afraid of dropping the repo for now. Anyone want to adopt it would be appreciated.

I can adopt it for now. The various problems gone and I have a working package.

Cheers,

Offline

Board footer

Powered by FluxBB