Project:Python/Eclasses

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.

General information
The Python ecosystem includes 5 core eclasses. Those are:
 * python-utils-r1 providing common utility functions for all other eclasses,
 * python-any-r1, python-single-r1 and python-r1 providing the basic framework for creating Python packages,
 * and distutils-r1 providing convenient interface to distutils, setuptools and compatible build systems.

Aside to the core eclasses, there might be one or more minor eclasses. At the moment, they include:


 * twisted-r1 for packages from the Twisted suite.

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


 * 1) Does your package use distutils, setuptools or a compatible build system ? If it does, use distutils-r1.
 * 2) Does your package need Python at build time only (and not install any scripts or modules)? If it does, use python-any-r1.
 * 3) Does the benefit of allowing user to select more than one implementation outweigh the implementation cost? If it does, use python-r1.
 * 4) Otherwise, use python-single-r1.