diff mbox series

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

Message ID 724a266846bef0af109ff0e5740217008f85872b.1665392835.git.paul.eggleton@linux.microsoft.com
State New
Headers show
Series [01/34] migration-general: add section on using buildhistory | expand

Commit Message

Paul Eggleton Oct. 10, 2022, 9:24 a.m. UTC
From: Paul Eggleton <paul.eggleton@microsoft.com>

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(+)

Comments

Paul Eggleton Oct. 10, 2022, 7:36 p.m. UTC | #1
On Monday, 10 October 2022 23:23:03 NZDT Joshua Lock wrote:
> > +``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
> 
> Nit: it would be nice to change BPN here to :term:`BPN`

Ah yes, well spotted. Fixed on the branch.

Thanks
Paul
diff mbox series

Patch

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