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.
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