On Tue, Jun 26, 2012 at 11:27 AM, Sascha Peilicke
On 06/25/2012 11:12 AM, todd rme wrote:
Considering all of the talk about improving openSUSE quality, and with 12.2 branched, I would like to discuss somewhat how to move forward with Python packaging in openSUSE.
Hi,
some other things I saw recently related to Python3 packaging:
BuildRequires: python3 BuildRequires: python3-devel
You need only one, not both. Generally, we recommend using the latter (as it should always work). For Python-only packages (i.e. no arch-dependant code contained) the former should suffice but it's more consistent to always use the -devel package.
This is not really the case. python3-devel depends on python3-base, not python3. Many packages, however, require the full python3 to build, because it contains additional functionality these packages depend on (often md5 or sha hash creation).
Requires: python3 >= %{py3_ver}
Is only needed on SLE-11, check "rpm -q --requires $PKG" (or "rpm -qp --requires $PKG"). You get those automatically, i.e. like this:
% rpm -qp --requires /var/tmp/build-root/openSUSE_Factory-x86_64/home/abuild/rpmbuild/RPMS/noarch/python3-pep8-1.3.1-0.noarch.rpm /usr/bin/python3 python(abi) = 3.2 ...
SLE-11 doesn't have python3 at all, that it why building is disabled for this target for all python3 packages in d:l:p (and for the d:l:p3 project completely). Pretty much all of the workarounds you see in the python3 packages are for openSUSE 11.4, which had a lot of problems with its python3 implementation (more on that later). If it isn't required for openSUSE 11.4 it can be removed, I will have to check.
As you recommended, we should probably update http://en.opensuse.org/openSUSE:Packaging_Python. Maybe a special paragraph should deal with SLE-11 compatibility issues, i.e. mentioning this beauty:
%if 0%{?suse_version} <= 1140 %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)} Requires: python3 >= %{py3_ver} %endif
This is an issue with openSUSE 11.4, not SLE 11. There were no python3 rpm macros shipped with openSUSE 11.4, so they have to be manually specified or the packages won't build. openSUSE 11.4 also has some problems with directory ownership, with the 64bit version of python3 not owning %python3_sitelib, which means these directories have to be manually owned by every noarch python3 package. Once openSUSE 11.4 is EOL we can remove a ton of workarounds in python3 packages. -Todd -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org