[Distutils] Self Introduction and Getting Hands On

Bohuslav Kabrda bkabrda at redhat.com
Tue Jun 26 13:23:32 CEST 2012


----- Original Message -----
> On 6/26/12 8:56 AM, Bohuslav Kabrda wrote:
> > Hi all,
> > I recently came upon Tarek's blogpost [1] about converting Python
> > packages to rpm specfiles. I have pretty good knowledge of this,
> > as I am a Fedora package maintainer and Python is one of my main
> > responsibilities. I have always wanted to become a Python
> > developer and becoming part of distutils-sig and trying to give a
> > helping hand with RPM related stuff is probably a good entry point
> > for me :)
> >
> > To introduce myself, I work at Red Hat as a package maintainer for
> > dynamic languages, I am author of the new Fedora-used pyp2rpm [2],
> > [3], which tries to do exactly what Py2RPM is supposed to be.
> > (Well, it's not perfect, but it can do 90 % of the work, usually.
> > So far, it doesn't work with distutils2, but I'll probably be
> > working on that when Python 3.3 gets released.) I also have some
> > minor not-yet-released projects in Python, I work with Django and
> > I'm just a Python enthusiast. In Fedora, I am a
> > maintainer/comaintainer of both Python and Python3, Django and
> > another 15+ (and growing) set of packages.
> >
> > Thanks for reading this through :) I'm looking forward to working
> > with - and learning from - all of you.
> >
> Welcome !
> 
> As I stated in the blog post, I think a separate project for all RPM
> -related stuff would make a lot of sense
> 

I agree. RPM (and distro-packaging in general) things have different lifecycle, so it may be nice to be able to reflect that.

> FWIW I have started a "pypi2rpm" project that creates RPM out of PyPI
> projects, we use at Mozilla to deploy our apps,
> http://pypi.python.org/pypi/pypi2rpm
> It's just a glue script on the top of an isolated bdist_rpm command
> and
> distutils2.version (for sorting versions) but you can also pass your
> spec file for a given
> project and have Fedora/RHEL specific options (like adding python26-
> prefixes etc)
> 
> It sounds like your project is on the other side, e.g. generating
> spec
> files out of Python projects, so I'd be really interested to see how
> it
> may replace bdist_rpm in pypi2rpm
> 

Exactly, my project is aimed at creating just the specfiles. In Fedora (and other distros as well), there is a review process that each package must go through and having a specfile written according to the current guidelines is a necessary part of that. "pypi2rpm" solves a different use case than distro-packagers need.

I have a pretty good idea about how distro-packagers would like things to work and combining it with the "pypi2rpm", I see it this way:
1) Starting point: we have a Python package.
2) We want to:
2a) directly convert it to binary RPM => we use "pypi2rpm" - good for Mozilla to deploy apps, not useful for distro-packagers
 - Producing binary RPM probably could be left in distutils, but looking at the bigger picture, RPM has different lifecycle than python standard library, so it might be good to pull this functionality out.
2b) produce a specfile/whatever that is called in other distributions => use Fedora's "pyp2rpm"/is there something similar for other distributions?
 - This should definitely be present in a library outside of Python - we may want to provide templates/distro-specific stuff here and be able to react to new releases of different distros (when they change their way of packaging).

So the best approach that currently comes to my mind is having a functionality in distutils, that can provide the package metadata (license, runtime/build requirements) and separate tool(s) that would be able to use these metadata to
a) convert directly to binary packages (rpm, deb, etc.)
or
b) produce specfiles/whatever for the packagers' reviews

Some questions that pop immediately are
- Should a) and b) be one library or two? They handle packages in completely different way.
- Should every distribution provide its very own library to handle a) and b) stuff or should these be a general libraries with distro-specific modules+templates?
...

How does this sound? This is just a general idea that came to my mind some time ago - feel free to dump it, if you don't like it :)

Have a nice day,
Slavek.

> Cheers
> Tarek
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig
> 

-- 
Regards,
Bohuslav "Slavek" Kabrda.


More information about the Distutils-SIG mailing list