Package Details: python-bz2file 0.98-1

Git Clone URL: https://aur.archlinux.org/python-bz2file.git (read-only)
Package Base: python-bz2file
Description: Python library for reading and writing bzip2-compressed files
Upstream URL: http://pypi.python.org/pypi/bz2file
Licenses: PSF
Submitter: iosonofabio
Maintainer: iosonofabio
Last Packager: iosonofabio
Votes: 2
Popularity: 0.004108
First Submitted: 2016-07-22 17:45
Last Updated: 2016-07-22 17:45

Latest Comments

edh commented on 2018-09-09 02:01

I guess I can not convince you. However, I still have to point out some errors in your argumentation. First of all, there is a difference between not being recommended and not being supported and AUR helpers are not supported and it is recommended that you now the build process prior to using one. Checking two PKGBUILDs if you install both versions is more complicated that checking just one. If you want to install the python3 version only, then the difference is merely a few addition lines. This has nothing to do with being careful. The official packages should be considered state-of-the-art and are not supposed to be some abstract script which no one actually runs.

iosonofabio commented on 2018-09-09 01:53

Official packages need not be built, which is the whole point.

Moreover, as you know using AUR helper is not the recommended way - AUR packages are to be considered unsafe, and any automatic install/uninstall process along those lines is to be considered a 2nd tier safety choice rather than a default.

Sorry if this careful attitude does not fit your taste. Feel free to make a package for python2 and maintain it if you need it, I don't mind keeping a clean python3 package for the time being.

Thank you

edh commented on 2018-09-09 01:49

The important part is, that it only adds makedependencies! A proper AUR helper will uninstall them after a build. Hence, the only added complexity is the (very short) waiting time for downloading python2-setuptools if it was not present already. Creating an additional python2 package would doplicate the required work as the releases and the building process has to be kept track of by two people. Please also bear in mind that all official packages of which I am aware use split PKGBUILDs ([1], [2], ...). I urge you to reconsider your opinion given how easy it would be for you to implement.

iosonofabio commented on 2018-09-08 14:48

Thanks for the PKGBUILD. Unfortunately this way of building adds python2 dependencies even to people that only need python3 (e.g. python2-setuptools).

I'd say either there's a way to build using conditional dependencies or please make a separate package for python2.

Thanks

edh commented on 2018-09-07 11:29

@iosonofabio Can you provide some comment as to whether the changes have a chance of being pulled into the PKGBUILD?

edh commented on 2018-08-27 05:52

Yes sure, of course. Most of the python packages I maintain at GitHub:Edenhofer/abs utilize this functionality. Although, to be honest, I am not using it in the most efficient way as I simply copy the source in order to build once using python2 and once using python3.

I am going a little bit against the rules and will simply paste the whole PKGBUILD which I would have written for bz2file in this commit instead of uploading it to a pastebin server. Please feel free to take from it whatever you find desirable.

pkgbase=python-bz2file
pkgname=('python-bz2file' 'python2-bz2file')
_pkgname=bz2file
pkgver=0.98
pkgrel=1
pkgdesc="Python library for reading and writing bzip2-compressed files"
arch=('any')
license=('Apache')
url="https://github.com/nvawda/bz2file"
makedepends=('python-setuptools' 'python2-setuptools')
_commit=0f9de6fe3ba736fbe837d09c052320339ef6da94
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/nvawda/bz2file/archive/${_commit}.tar.gz")
sha512sums=('db14f6650cca200b852c5932fd84855fa2344c671b9fcefc6a00d4039a278193bf4c7e78d7f16dcbe792c13ded8bcbb6891b09ff111e6cc3fedbd9164b03c4a3')

prepare() {
    cp -a "${srcdir}/${_pkgname}-${_commit}"{,-py2}
}

build() {
    cd "${srcdir}/${_pkgname}-${_commit}"
    python setup.py clean
    rm -rf build dist
    python setup.py build

    cd "${srcdir}/${_pkgname}-${_commit}-py2"
    python2 setup.py clean
    rm -rf build dist
    python2 setup.py build
}

package_python-bz2file() {
    depends=('python')

    cd "${srcdir}/${_pkgname}-${_commit}"
    python setup.py install --root="${pkgdir}" --optimize=1
}

package_python2-bz2file() {
    depends=('python2')

    cd "${srcdir}/${_pkgname}-${_commit}-py2"
    python2 setup.py install --root="${pkgdir}" --optimize=1
}

I took the liberty to change the URL as even PyPI lists their GitHub page as "Homepage" and redirected the download to a specific commit at GitHub.

iosonofabio commented on 2018-08-24 17:02

I can but have never done it, would you please cite an example of this?

edh commented on 2018-08-24 09:14

Can you add a python2 version of the package in addition to the currently existing python3 one? It would enable other packages which depend on bz2file to also package python2 versions.

The whole procedure should be fairly simple if using split-package functionality.