[Exherbo-dev] Python changes

Bo Ørsted Andresen zlin at exherbo.org
Wed Nov 13 18:02:36 UTC 2013


Hi

In order to facilitate python multibuild, we have introduced
setup-py.exlib and changed the API for python.exlib. The new API is
incompatible with the previous multibuild python packaging, and
packages which are currently relying on python.exlib APIv2 will need to
be converted to the new system. Currently, we have 70 packages that
have yet to be converted, and any help fixing those is appreciated. I
attached a list.

For multibuild python, distutils.exlib and setuptools.exlib are now
deprecated in favour of the new setup-py.exlib which combines both of
them.

setup-py.exlib has additional support for enabling nose tests and
pytests and for configuring packages that need a setup.cfg or site.cfg
file.

There is no longer any default ABI for python. For python executables
the highest supported python will now be used by default. To override,
one can run the executable with an older supported python as desired.
E.g. `python2.7 /usr/bin/foo`.

A few notes about how to fix packages broken by these changes follow.
The headers of python.exlib and setup-py.exlib contain documentation of
the supported exparams.

First a couple of examples. In the old syntax API 2 was enabled when
the python_dep exparam started with a square bracket:

    require python [ python_dep="[>=2.7.2][blah]" python_sup="2.7 3.2 3.3" ]

The equivalent new syntax:

    require python [ blacklist="2.6 3.1" min_versions="2.7.2" python_opts="[blah]" ]

Api 2 is enabled through setting the blacklist exparam. If nothing
needs to be blacklisted it's set to blacklist="none". Refer to the
headers of the exlibs for further details.

I would much appreciate if people converting packages would take great
care to verify:

1) That any installed executables get the shebang right.

    a) For packages that can use any python version where the python
       version is switchable at run time, it should be:

         #!/usr/bin/env python

    b) For packages that can use any python 2 version where the python
       version is switchable at run time, it should be:

         #!/usr/bin/env python2

       Similar for python3.

    c) For packages that need a specific version, this includes any
       package that contains libs in site-packages, it should be e.g.:

         #!/usr/bin/env python3.3

       Where 3.3 is the highest version that is supported and enabled.

2) That things that require setup-py [ import=setuptools ] really uses
   setuptools and vice versa.

Typically those are recognised by something in setup.py like:

    "from setuptools import blah"

Note that:

    "def use_setuptools(*args, **kwargs): pass"

in ez_setup.py does not imply use of setuptools. That gets inserted by
distutils.exlib.

3) That blacklisted python versions really don't work and vice versa.

4) That the package does not include any working tests that don't get
   run. Note the test exparam in setup-py.exlib.

--
Bo Ørsted Andresen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multipy-broken
Type: application/octet-stream
Size: 2230 bytes
Desc: not available
URL: <http://lists.exherbo.org/pipermail/exherbo-dev/attachments/20131113/12804650/attachment.obj>


More information about the Exherbo-dev mailing list