Mailinglist Archive: opensuse-packaging (130 mails)

< Previous Next >
[opensuse-packaging] How to Build and Package Python 3 Packages?
  • From: Thomas Schraitle <toms@xxxxxxx>
  • Date: Sat, 13 Mar 2010 11:20:36 +0100
  • Message-id: <201003131120.36753.toms@xxxxxxx>
Hi,

in my repository I package a lot of Python packages almost exclusively for
version 2.x. I use the template described in [1] which works pretty well in
most cases. So far, so good.

However, I haven't found anything that covers how to build Python 3 packages.
As most projects probably will consider either switching to the new version or
supporting both versions, I think this will become more and more important.
Maybe I missed something, but at the moment it seems to me, the details are
not fully described.

Maybe some friendly developer can give me some recommendations:


1. Are there any RPM macros definied for Python3?

In /usr/lib/rpm/macros there are the usual suspects like py_prefix, py_libdir,
etc. However, these macros are definied for Python2.x only. I haven't found
macros for Python3 yet. Do I have to define it myself or where can I find
them? What is recommended in this case?


2. What is the official naming schema for Python 3 packages?

I saw that some packages in the OBS starts with the prefix "python3-" which I
think is a good idea. Is this a convention or an official policy? Is it
expected that Python2 packages will be renamed to "python2-" and Python3
packages become "python-"? Similar to the KDE3/KDE4 package renaming?
(My impression is this will not happen soon.)


3. How to build packages in OBS which are written for Python 2.x and 3.x?

I maintain the package python-lxml[2]. The source can be build for both
versions which is good. :)
I tried some variations but in the end I wrote two spec files: python-
lxml.spec and python3-lxml.spec and committed it.

However, OBS seems to build only the packages for python-lxml and doesn't look
at the python3-lxml.spec. Do I have to create another project? If possible, I
would like to keep everything in one project. Any recommendations here?


4. Anything else which is important for building Python 3.x packages?


Thanks,
Tom

--------
[1] http://en.opensuse.org/Packaging/Python
[2] https://build.opensuse.org/package/show?package=python-
lxml&project=home%3Athomas-schraitle

--
Thomas Schraitle

----------------------------------------------------------------------
SUSE LINUX GmbH >o) Documentation Specialist
Maxfeldstrasse 5 /\\
90409 Nuernberg _\_v http://en.opensuse.org/Documentation_Team
http://developer.novell.com/wiki/index.php/Lessons_for_Lizards
http://lizards.opensuse.org/author/thomas-schraitle/
---------------------------------------------------------------------
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups