Project:Python/Eclasses

From Gentoo Wiki
< Project:Python
Revision as of 08:24, 14 September 2013 by MGorny (Talk | contribs)

Jump to: navigation, search

The Python eclasses are eclasses maintained by the Gentoo Python team and aimed at helping writing ebuilds that install Python scripts, modules or simply require or use Python.

-r1 eclasses

General information

The currently supported suite of Python eclasses is called the python-r1 suite. It consists of the eclasses listed in the following table:

Eclass Goal/use
distutils-r1 packages using distutils or setuptools (setup.py) build system
python-any-r1 packages which need Python interpreter during build-time (incl. tests)
python-single-r1 packages which install files that are used with one (and only one) of installed Python interpreters
python-r1 packages which install files that may be used with one or more of installed Python intepreters
python-utils-r1 common helper functions
twisted-r1 packages from the Twisted suite and Twisted plugins

Choosing the correct eclass

In order to easily choose the correct eclass, you can use the following algorithm. You should stop on the first eclass that matches.

  1. If you install Twisted plugins, use twisted-r1.
  2. If your package uses distutils or setuptools (setup.py), use distutils-r1.
  3. If your package installs modules that need to work correctly with more than one of installed Python interpreters, use python-r1.
  4. If your package installs Python scripts or modules, links to libpython or needs to enforce one of specific versions of Python on its build-time dependencies, use python-single-r1.
  5. If your package uses Python interpreter at build-time and/or for tests, use python-any-r1.

-r0 eclasses

These are the old eclasses that are no longer developed or supported. Their use is discouraged.

Eclass Goal/use
distutils packages using distutils or setuptools (setup.py) build system
python any Python packages
twisted packages from the Twisted suite and Twisted plugins