[aur-general] Python packaging: to build or not to build (Re: Review request for 3 related PKGBUILDs)

Levente Polyak anthraxx at archlinux.org
Thu Feb 16 14:12:39 UTC 2017


On 02/15/2017 02:43 AM, Eli Schwartz via aur-general wrote:
> On 02/14/2017 07:44 PM, Bruno Pagani wrote:
>> So, if I understand things well, python{,2} setup.py build should do the
>> same thing for most package, and any one of the two could be used to
>> then package the two versions? So this would work:
>> build() {
>>     python setup.py build
>> }
>> package_python-lib() {
>>     python setup.py install --root="$pkgdir" --optimize=1 --skip-build
>> }
>> package_python2-lib(){
>>     python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
>> }
>>
>> Then I would be more in favour of splitting build and package.
>>
>> Thanks for your input,
>> Bruno
> 
> Basically, yeah. Run the setuptools PKGBUILD and diff the srcdir --
> you'll see they are practically byte-identical. There is a small handful
> of 2/3 references, but setuptools rewrote those in the first place, and
> other than that there's just __pycache__ vs side-by-side bytecode.
> 
> https://paste.xinu.at/aY2BmFZryz/
> 

It of cause always depends on the package and how and what it does.
Consider you want to run some test suite with py.test or an own suite
not strictly wired to setuptools, then you need to build before the
package. On top of this it may also contain native code and compile a
.so library (that will also be needed in the test suite), in such case
you will also need to build for both, python2 and python3 before being
able to run the test suits.
Just wanted to leave this as a small hint :]

cheers,
Levente

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20170216/b13a3b51/attachment.asc>


More information about the aur-general mailing list