Browse Source

Create function/variable index

Signed-off-by: Michał Górny <mgorny@gentoo.org>
pull/2/head
Michał Górny 2 years ago
parent
commit
81a5a90c8b
No known key found for this signature in database GPG Key ID: 639ADAE2329E240E
  1. 3
      any.rst
  2. 8
      basic.rst
  3. 5
      depend.rst
  4. 27
      distutils.rst
  5. 13
      helper.rst
  6. 1
      index.rst
  7. 8
      multi.rst
  8. 4
      single.rst

3
any.rst

@ -51,6 +51,9 @@ the three highlighted lines are specific to Python eclasses, plus
the implicitly exported ``pkg_setup`` phase.
.. index:: python_gen_any_dep; python-any-r1
.. index:: python_check_deps; python-any-r1
Dependencies
============
When depending on other Python packages, USE dependencies need to be

8
basic.rst

@ -10,6 +10,8 @@ explain the common bits used by all of them, as well as the non-obvious
differences between them.
.. index:: PYTHON_COMPAT
PYTHON_COMPAT
=============
The ``PYTHON_COMPAT`` variable is used by all Python eclasses, and must
@ -27,6 +29,9 @@ Typical use::
inherit python-single-r1
.. index:: PYTHON_DEPS
.. index:: PYTHON_REQUIRED_USE
PYTHON_DEPS and PYTHON_REQUIRED_USE
===================================
The ``python-any-r1``, ``python-single-r1`` and ``python-r1`` eclasses
@ -51,6 +56,9 @@ This does not apply to ``distutils-r1`` as it does the above assignment
by default.
.. index:: EPYTHON
.. index:: PYTHON
Python environment
==================
The eclasses commonly use the concept of *Python environment*. This

5
depend.rst

@ -4,6 +4,9 @@ Advanced dependencies
.. highlight:: bash
.. index:: PYTHON_REQ_USE
.. index:: python_gen_impl_dep
Requesting USE flags on the Python interpreter
==============================================
While the majority of Python standard library modules are available
@ -105,6 +108,8 @@ SQLite support when running tests:
distutils_enable_tests pytest
.. index:: python_gen_cond_dep; for conditional deps
Dependencies conditional to Python version
==========================================
When packaging software for multiple Python versions, it is quite likely

27
distutils.rst

@ -78,6 +78,8 @@ the widest test coverage, and avoid unpredictable test failures on users
who have more dependencies installed).
.. index:: DISTUTILS_SINGLE_IMPL
python-single-r1 variant
========================
Normally, ``distutils-r1`` uses ``python-r1`` to build multi-impl
@ -127,6 +129,8 @@ to be rewritten.
sci-physics/root[${PYTHON_SINGLE_USEDEP}]"
.. index:: DISTUTILS_USE_SETUPTOOLS
Different build system variations
=================================
The most basic example presented above assumes that the package is using
@ -182,6 +186,8 @@ via setuptools. For this purpose, a build-time dependency
on ``dev-python/pyproject2setuppy`` is added.
.. index:: DISTUTILS_IN_SOURCE_BUILD
In-source vs out-of-source builds
=================================
In the general definition, an *out-of-source build* is a build where
@ -241,7 +247,6 @@ files are contained within the copy used for the current interpreter.
DISTUTILS_IN_SOURCE_BUILD=1
Sub-phase functions
===================
Ebuilds define phase functions in order to conveniently override parts
@ -277,6 +282,9 @@ implementation. However, if in-source builds are enabled, all phases
are run in these build directories.
.. index:: python_prepare
.. index:: python_prepare_all
python_prepare
--------------
@ -324,6 +332,9 @@ precisely why ``python_prepare`` automatically enables in-source builds.
}
.. index:: python_configure
.. index:: python_configure_all
python_configure
----------------
@ -348,6 +359,9 @@ global environment variables.
}
.. index:: python_compile
.. index:: python_compile_all
python_compile
--------------
@ -373,6 +387,9 @@ the documentation (see ``distutils_enable_sphinx``).
}
.. index:: python_test
.. index:: python_test_all
python_test
-----------
@ -389,6 +406,9 @@ to Python.
}
.. index:: python_install
.. index:: python_install_all
python_install
--------------
@ -422,6 +442,8 @@ such as bash completions or examples.
}
.. index:: distutils_enable_tests
Enabling tests
==============
Since Python performs only minimal build-time (or more precisely,
@ -437,6 +459,7 @@ specify a test runner that's not strictly necessary — e.g. specify
anywhere and work just fine with built-in modules. The best way
to determine the test runner to use is to grep the test sources.
Using distutils_enable_tests
----------------------------
The simplest way of enabling tests is to call ``distutils_enable_tests``
@ -650,6 +673,8 @@ Note that ``python_test`` is called by ``distutils-r1_src_test``,
so you must make sure to call it if you override ``src_test``.
.. index:: distutils_enable_sphinx
Building documentation via Sphinx
=================================
``dev-python/sphinx`` is commonly used to document Python packages.

13
helper.rst

@ -2,6 +2,15 @@
Common helper functions
=======================
.. index:: python_doexe
.. index:: python_newexe
.. index:: python_doscript
.. index:: python_newscript
.. index:: python_domodule
.. index:: python_doheaders
.. index:: python_scriptinto
.. index:: python_moduleinto
Install helpers
===============
The install helpers are provided commonly for ``python-single-r1``
@ -75,6 +84,8 @@ extensions::
python_doheader src/libImaging/*.h
.. index:: python_fix_shebang
Fixing shebangs on installed scripts
====================================
If upstream build system installs Python scripts, it should also update
@ -124,6 +135,8 @@ to install a script with ``python2`` shebang for Python 3. ``-f``
}
.. index:: python_optimize
Byte-compiling Python modules
=============================
Python modules are byte compiled in order to speed up their loading.

1
index.rst

@ -21,4 +21,5 @@ Gentoo Python Guide
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`

8
multi.rst

@ -11,6 +11,8 @@ or a similar Python build system, ``distutils-r1`` eclass should be used
instead.
.. index:: python_foreach_impl
Manual install
==============
The simplest case of multi-impl package is a package without a specific
@ -86,6 +88,8 @@ need to be executed:
}
.. index:: PYTHON_USEDEP
Dependencies
============
When depending on other Python packages, USE dependencies need to be
@ -100,6 +104,8 @@ to the dependencies::
DEPEND="${RDEPEND}"
.. index:: run_in_build_dir
Pure Python autotools package
=============================
Another typical case for this eclass is to handle a pure Python package
@ -299,6 +305,8 @@ rules for installing Python files as they are suitable only for
single-impl installs.
.. index:: python_setup; for python-r1
Additional build-time Python use
================================
Some packages additionally require Python at build time, independently

4
single.rst

@ -54,6 +54,10 @@ the four highlighted lines are specific to Python eclasses, plus
the implicitly exported ``pkg_setup`` phase.
.. index:: PYTHON_SINGLE_USEDEP
.. index:: PYTHON_MULTI_USEDEP
.. index:: python_gen_cond_dep; for python-single-r1
Dependencies
============
When depending on other Python packages, USE dependencies need to be

Loading…
Cancel
Save