hi, thank you for bringing this up. Packaging for python3 is a rather new topic and it's not very well researched. I invite everyone interested to contribute to creation of python3 packaging conventions. To your questions: Dne 13.3.2010 11:20, Thomas Schraitle napsal(a):
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?
Macros for python3 will be added to python3 package, and probably to RPM later on as well. They're not there yet - my bad. I will try to take time and add them soon. At the moment it's best to define the macros in your sources. I am not sure about naming scheme yet, we should consult this with Fedora (and possibly Mandriva, but i'm not sure how much they're interested). I'm adding Pavol Rusnak to CC, as he is in contact with Fedora packagers. It probably makes sense to call the macros %py3_something and %python3_something.
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.)
As the policy is not defined yet, "python3-" prefix is just a convention. But it will be included in the policy, so please use this naming scheme. There is no plan for KDE-like renaming in the foreseeable future.
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.
At the moment it is not possible to build from the same spec. I don't have any idea how to do it. Suggestions are welcome. You would still need two different packages because of python version requirements, though.
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?
Create a new package in the same project, name it python3-lxml and link to python-lxml. It will pick up the other spec and build it. See how python-base and python-doc are built in d:l:py:Factory.
4. Anything else which is important for building Python 3.x packages?
Python3 is not split yet, and i am not sure about noarch support in it. I was working on it, but it is not finished yet. That is all that comes to mind. Ideas, anyone? regards m. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org