Hi, On Fri, Aug 19, 2016 at 04:01:22PM +0200, jan matejek wrote:
hello folks,
as this got somehow tangled in the big python-python-* thing, I'd like to announce a working prototype of the new macroset that will let us easily build Python 2 and Python 3 packages from a single spec file.
Great news!
Note that this has been possible most of the time, for anyone willing to manually write two filelists, two descriptions, two sets of requirements, etc. etc.
But with this new development, it is now possible to run a spec file through a set of small conversions and get working packages with correct dependencies (hopefully).
The changes you need to make:
- include `%python_subpackages` macro somewhere in your specfile, preferably after the `%description` section
- convert `python setup.py build` to `%python_build` and `python setup.py install` to `%python_install`.
Is this based on %py2_build, %py3_build, %py2_install and %py3_install? Would be nice to have theses macros, too (they are avaialble in Fedora).
Or copy your python2-specific build instructions and change instances of python2 to python3 (or vice versa).
- convert all `BuildRequires: python-$something` to `BuildRequires: %{python_module $something}`
What if a BuildRequires or Requires is only needed for a specfic version (described via marker, see pep-0496 in setup.cfg or requirements.txt) ?
Limitations: - filelists must be the same. I have not figured out a way to make this work otherwise, except maybe by forcing the packager to write out both (all) %files sections by hand, which doesn't seem satisfactory. - subpackages are not supported just yet. They are on the roadmap. - no automated handling of update-alternatives, but that's a whole different story - i have no idea what happens to packages that don't build with distutils/setuptools
Anyone interested can have a look at home:matejcik:messing-with-macros repository [1]. I'll probably use rest of today to fork off devel:languages:python:singlespec sub-repository and start copying packages to it. Once a critical mass of packages is there, and unless there are major objections, I'll go ahead and delete with maximum prejudice the ill-considered devel:languages:python3 repository which is a mistake that burdens us to this very day...
It would also be nice to get other distros (by which i really mean Fedora) in on this. Anyone here knows how to make that happen?
Fedora already has single specs for py2/py3 packages. Or what exactly do you mean? Best, Tom -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org