Python-r1/examples

Basic example
The PYTHON_DEPEND and RESTRICT_PYTHON_ABIS tandem was replaced with a common PYTHON_COMPAT variable. The variable needs to list explicitly every supported Python implementation. It is used to construct USE flags for the implementations and prepare proper dependency strings.

The SUPPORT_PYTHON_ABIS variable was replaced with an implication of eclass choice. The python-r1 and distutils-r1 eclasses require the package to support being built for multiple Python implementations.

The PYTHON_MODNAME variable was removed. The modules are compiled during the install phase, therefore the ebuild is perfectly aware of the module naming.

A PYTHON_USEDEP variable has been introduced. It holds a USE dependency string requiring the dependency to have at least the same Python implementations enabled as the ebuild in question. Its use is for packages that inherit the python-r1 or distutils-r1 eclasses.

The default phase functions handle all the common tasks which base.eclass did. Therefore, it is no longer necessary to use it explicitly.

Running tests using py.test
The distutils-r1 eclass does not support various Python test suites out-of-the-box. Therefore, it is necessary to add appropriate dependencies and the python_test phase function.

In order to use the py.test test suite, it is necessary to depend on dev-python/pytest and call py.test to run the tests.

It should be noted that the DOCS variable in distutils-r1 is a list, not a string.