[PATCH 14/34] ref-manual: add pypi class

Paul Eggleton
2022-10-10T09:24:44Z

Add missing documentation for the pypi class.

Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
---
documentation/ref-manual/classes.rst | 14 ++++++++++++++
documentation/ref-manual/variables.rst | 8 ++++++++
2 files changed, 22 insertions(+)

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index d94db03..f6bbee5 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -2005,6 +2005,20 @@ When inherited by a recipe, the ``perlnative`` class supports using the
native version of Perl built by the build system rather than using the
version provided by the build host.

+.. _ref-classes-pypi:
+
+``pypi.bbclass``
+================
+
+The ``pypi`` class sets variables appropriately for recipes that build
+Python modules from `PyPI <https://pypi.org/>`__, the Python Package Index.
+By default it determines the PyPI package name based upon BPN (stripping the
+"python-" or "python3-" prefix off if present), however in some cases you may
+need to set it manually in the recipe by setting :term:`PYPI_PACKAGE`.
+
+Variables set by the ``pypi`` class include :term:`SRC_URI`, :term:`SECTION`,
+:term:`HOMEPAGE`, :term:`UPSTREAM_CHECK_URI`, and :term:`UPSTREAM_CHECK_REGEX`.
+
.. _ref-classes-python_flit_core:

``python_flit_core.bbclass``
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index e4304d1..ceb6b0e 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -6219,6 +6219,14 @@ system and gives an overview of their function and contents.

:term:`PV` is the default value of the :term:`PKGV` variable.

+ :term:`PYPI_PACKAGE`
+ When inheriting the :ref:`pypi <ref-classes-pypi>` class, specifies the
+ `PyPI <https://pypi.org/>`__ package name to be built. The default value
+ is set based upon :term:`BPN` (stripping any "python-" or "python3-"
+ prefix off if present), however for some packages it will need to be set
+ explicitly if that will not match the package name (e.g. where the
+ package name has a prefix, underscores, uppercase letters etc.)
+
:term:`PYTHON_ABI`
When used by recipes that inherit the
:ref:`setuptools3 <ref-classes-setuptools3>` class, denotes the
--
1.8.3.1