[aur-general] [REVIEW REQUEST] python-viivakoodi

Quentin Bourgeois quentin at bourgeois.eu
Tue Nov 29 00:47:14 UTC 2016


On 16-11-27 19:41:06, Eli Schwartz via aur-general wrote:
> On 11/27/2016 06:10 PM, Quentin Bourgeois wrote:
> > With this, I come with a simpler PKGBUILD[0] in which I push
> > modifications you advised. I also removed some dependencies that are
> > used for code coverage and building documentation, which I do not
> > install for now.
> > 
> > Did we get to something good ?
> > 
> > [0] https://git.bourgeois.eu/aur_python_viivakoodi.git/tree/
> 
I should comes with all modification on this batch.

> Err, why do both split packages provide 'python2-viivakoodi'? One of
> them already is 'python2-viivakoodi', and the other by definition
> doesn't supply it, being Python 3.
My mistake.
 
> You declare setuptools as a makedepends only, but I hate to inform you
> that setuptools-installed packages have a runtime dependency on
> setuptools to launch their console scripts. (This is the downside of
> having python itself be capable of generating the entry point launchers
> in a cross-platform manner -- rather than using your own python scripts
> with file extensions, then assuming Linux users will be happy with the
> extension and Windows users will be able to launch a non-binary.)
> 
> For module-only python packages, it is only a makedepends... for
> packages which ship with console_scripts you need it at runtime as well,
> otherwise the console_scripts will fail trying to import pkg_resources.
> 
> You can either have each split package depend on python{,2}-setuptools,
> or depend on both that and the python{,2} package itself. I have seen it
> done both ways.
Hum, this was not abvious for me, thanks. With what I have understand
from that I have decide to make every split package depend on pythonX
and pythonX-setuptools its seem simpler for me to understand.

I will dig this setuptools + console_script topics by my own.

On this, when I run namcap on created packages I get some warnings:

$ namcap *.tar.xz
python2-viivakoodi W: Dependency python2 included but already satisfied
python2-viivakoodi W: Dependency included and not needed ('python2-setuptools')
python-viivakoodi W: Dependency python included but already satisfied
python-viivakoodi W: Dependency included and not needed ('python-setuptools')


For every packages the first warning is due to my choice. For the
second does namcap could warn packager that are not aware of the
setuptools+console_scripts things (or maybe its something well known
?). 

> 
> ...
> 
> There are still some optional style preferences, like leaving a line of
> whitespace after the "# Maintainer:" line and reusing the "$url"
> variable in the source array. Feel free to take that or leave it, though. :)
> Also, I don't usually see people initializing an array with += but it
> isn't like that is harmful.
> Also, the permissions mode in chmod/install assumes leading zeroes, so
> you don't need to explicitly say those licenses are lacking in
> suid/sticky attributes.

Integrated, the += intialization was due to the empty variables
remove.

On style preferences, when I code in Bash I over use {} arround
variables (mainly when variables are tied to other strings). What is
the guideline on this ?

> 
> -- 
> Eli Schwartz
-------------- next part --------------
# Maintainer: Quentin Bourgeois <quentin+archlinux at bourgeois.eu>

pkgbase=viivakoodi
pkgname=("python2-$pkgbase" "python-$pkgbase")
pkgver=0.8.0
pkgrel=1
pkgdesc='Barcode generator for Python. Fork of pyBarcode project.'
arch=('any')
url="https://github.com/kxepal/$pkgbase"
license=('MIT')
source=("$pkgbase-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('e1a17dc24975d5242202cfbb7534d69dd14eeb26bdf8a10f056c7b04904fef1e')

check() {
    cd "$srcdir/$pkgbase-$pkgver"
    
    for py_int in python3 python2; do
        msg "Testing $pkgbase-$pkgver with $py_int"
        "$py_int" ./test.py
    done
}

package_python-viivakoodi() {
    depends=('python'
             'python-setuptools')
    optdepends=('python-pillow: render barcodes as images')
    checkdepends=('python-pytest'
                  'python-mock'
                  'python-tox')
    cd "$srcdir/$pkgbase-$pkgver"
    python setup.py install --root="$pkgdir/" --optimize=1

    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE.launcher"
}

package_python2-viivakoodi() {
    depends=('python2'
             'python2-setuptools')
    optdepends=('python2-pillow: render barcodes as images')
    checkdepends=('python2-pytest'
                  'python2-mock'
                  'python2-tox') 

    cd "$srcdir/$pkgbase-$pkgver"
    python2 setup.py install --root="$pkgdir/" --optimize=1

    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE.launcher"
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20161129/543bac2b/attachment.asc>


More information about the aur-general mailing list